[racket] Multiple return values

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Wed Dec 14 07:56:15 EST 2011

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


Posted on the users mailing list.