On Sun, Jan 6, 2013 at 4:31 AM, Andy Wingo <[email protected]> wrote:

> The specification for `and' notes that "If all the expressions evaluate
> to true values, the value of the last expression is returned."  This is
> not the case: as the last expression is in tail context, the _values_ of
> the last expression are returned.  Same with `or', `when', and
> `unless'.
>

Pluralized for `and'.  I'm not sure about `or' - I think it would
always be a mistake to use MVs in an or expression.


> Contrary to their specifications and the "differences from r6rs"
> appendix, the return value of `when' and `unless' is indeed specified if
> the body is evaluated, as the body is in tail position.
>

No, this was a mistake on R6RS's part.  It is meaningless
to return values from `when' or `unless', so we explicitly state
that "the result of the when/unless expression is unspecified."

This arguably conflicts, as you point out, with the specification
of these as tail forms.  I think since we can't rule out the
possibility of compiler techniques that allow for unspecified
result tail calls this is not a problem.

The important thing is not to suggest it would ever be
sensible to use the result of a when or unless.

-- 
Alex
_______________________________________________
Scheme-reports mailing list
[email protected]
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

Reply via email to