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" <dvanh...@ccs.neu.edu>
To: users@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

Reply via email to