[r6rs-discuss] multiple value returns to non-tail positions in `begin' et al
aghuloum at cs.indiana.edu
Sat Nov 1 17:31:27 EDT 2008
On Nov 1, 2008, at 3:07 PM, Andy Wingo wrote:
> Greetings wranglers of the lambda calculus,
> Quoth the R6:
> The continuations of all non-final expressions within a
> sequence of
> expressions, such as in lambda, begin, let, let*, letrec, letrec*,
> let-values, let*-values, case, and cond forms, usually take an
> arbitrary number of values.
> Question 1: "Usually"?
Looks like an editorial oversight. Cross "usually".
> Question 2: Why the change from R5, which sayeth:
> Except for continuations created by the `call-with-values'
> procedure, all continuations take exactly one value.
Because such continuations (e.g., in a begin) ignore their values.
Is there a reason to restrict them to a single value which they
ignore anyways, and force them to signal an error when given anything
other than a single value?
> Question 3: Does anyone's Scheme, R5 or R6, error with the following:
> (define (nothing) (values))
> ((lambda () (nothing) 1))
> This seems to be equal to 1 with R6, and undefined in R5. Of special
> interest are those schemes that do not construct compound objects for
> multiple value returns.
Ikarus does not construct compound objects for multiple values;
It also does not signal an error on that correct program. Chez
is similar on both counts. I don't know about the internals of
More information about the r6rs-discuss