For Programmers: Free Programming Magazines  


Home > Archive > Scheme > March 2004 > Safely finding out how many values a continuation takes?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Safely finding out how many values a continuation takes?
Sunnan

2004-03-27, 12:25 am

There is no way, right? I was trying to define something I call
''svalues'', which is like values but it delivers only its first value
to its continuation if that continuation wasn't created by
call-with-values or a macro upon that (in which case it should work just
like regular values). So, can it be done? I found an older message on
this group, <357D747E AAECE33E ccs neu edu>, which seems to imply that
the pred ''current-continuation-accepts-multiple-values?'' can't easily
be written in Scheme.

The reason it came up was that I'm reading through Graham's _On Lisp_
(which uses Common Lisp rather than Scheme for most of it's examples)
and I thought it was interesting that Common Lisp just threw away all
but the first instead of erroring, unless using ''multiple-values-bind''
(which to me seemed to be exactly like ''receive'' as defined in SRFI-8).

(BTW, I am aware that I could program in CPS instead but this is also
intended as curiosa.)

One love, Sunnan.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com