[plt-scheme] Why multiple values?

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Sun Dec 24 20:25:32 EST 2006

On 12/24/06, gregory.woodhouse at sbcglobal.net
<gregory.woodhouse at sbcglobal.net> wrote:
>
> So, here's another basic question: If I know that f returns multiple values, but I don't know how many, but I do know that I only care about, say, the first two values, can I get them as x and y? Can I gain access to all the values, even if I don't know in advance how many there are?

You can use call-with-values for that, and the function you call can
take the arbitrary number of values as an arbitrary number of inputs.
It's not an elegant thing to deal with, without writing a custom
macro.

-- 
Carl Eastlund


Posted on the users mailing list.