[r6rs-discuss] Thing1: Dealing with VALUES

John Cowan cowan at ccil.org
Thu Dec 3 02:07:53 EST 2009


David Rush scripsit:

> [1] I vaguely recall someone saying that Common Lisp uses APPLY/LIST
> for CALL-WITH-VALUES/VALUES and takes the car of the returned object
> if the continuation only accepts a single value

CL returns multiple values using VALUES, the same as R5RS.  There are
a set of syntaxes for receiving multiple values: MULTIPLE-VALUE-BIND,
which is the same as LET-VALUES in SRFI 11; MULTIPLE-VALUE-CALL,
which calls a function passing all the values of all the argument
forms; MULTIPLE-VALUE-LIST, which returns a list of all the values;
MULTIPLE-VALUE-PROG1, which evaluates all its arguments and returns the
values of the first argument only; MULTIPLE-VALUE-SETQ, which is like
M-V-BIND but does assignments rather than making bindings; and NTH-VALUE,
which returns the nth value only.  M-V-CALL and M-V-PROG1 are primitive.

There is also a function VALUES-LIST, which applies VALUES to its arguments.

-- 
John Cowan              http://www.ccil.org/~cowan      cowan at ccil.org
Would your name perchance be surname Puppet, given name Sock?
                --Rick Moen



More information about the r6rs-discuss mailing list