2009/9/5 John Cowan <[email protected]>:

> (Almost.  A continuation has to check how many arguments it expects
> at run time, because there's no way in Scheme to declare the number
> of values that a procedure returns.  I argued for (lambda 2 (a b c)
> (values a b)), but Felix said it was too ugly.)

It would be a better expression than we have now, but it would still 
inject bindings for return values a and b into the calling 
environment, breaking lexical scope.  

If lexical scope is to be preserved, then the call site rather than 
the function has to bind the values to be recieved from the function 
(as in the receive form).  But if first-class functions are to be
preserved, then the number of returns is a property of the function 
and not a property of the call site.  

It's probably not a coincidence that 'parameters' and other forms 
that break lexical scope come under consideration at roughly the 
same moment in history as multiple returns. 

                                        Bear



_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to