[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
question about official definition of SETQ in CLtL2 p. 121
Date: Sun, 10 Jan 1993 03:08 EST
SLUG might not be the right forum for this. Could someone please point me to
the correct mailing list.
The question is this: What is supposed to be the value returned by
(SETQ X (VALUES 1 2))?
CLtL2 p. 121 is ambiguous on this. It says ``SETQ returns the last value
assigned, that is, the result of the evaluation of its last argument.''
In this case ``the last value assignned'' is 1 but ``the result of evaluating
the last argument'' is the multiple value 1 2. So should (SETQ X (VALUES 1 2))
return the single value 1 or the multiple value 1 2? I'm not asking what
implementations actually do, I'm asking what the correct interpretation of
CLtL2 is and whether this is made more explicit in the ANSI draft.
The corect interpretation is the one which is indeed made more explicit in the
ANSI draft. In the draft, the value assigned to each var, and the returned value,
are the primary values of the respective forms. The primary value is defined to be
the first value if there are one or more values, and nil if there are no values.