[racket] Multiple return values

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Dec 14 09:15:33 EST 2011

CPS is for old people. Be careful. 

See Dybvig's paper on measurable benefits (or lack thereof) for values and friends. 




On Dec 14, 2011, at 9:00 AM, J. Ian Johnson wrote:

> In CPS, n-return values just means your continuation is n-ary. You don't need to allocate cells to put all your return values in. I don't know if Racket's implementation doesn't need to allocate, but that's also a bonus.
> -Ian
> ----- Original Message -----
> From: "David Van Horn" <dvanhorn at ccs.neu.edu>
> To: users at racket-lang.org
> Sent: Wednesday, December 14, 2011 7:56:15 AM GMT -05:00 US/Canada Eastern
> Subject: Re: [racket] Multiple return values
> 
> On 12/14/11 5:54 AM, Zayr Okale wrote:
>> Hello, everyone.
>> 
>> Can someone please explain to me multiple return values? Not what it
>> does, I understand that much, but what is this feature for? In what
>> situations is it useful?
> 
> It's useful in situations where several values are the result of a 
> single computation.  A simple example of this situation is the quotient 
> and remainder of an integer division.
> 
> There's also a more philosophical argument for them which is that, for 
> symmetry, functions should be able to produce multiple results since 
> they may consume multiple inputs.
> 
> David
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users




Posted on the users mailing list.