Re: [Scheme-reports] multiple values, and, or, when, unless Andy Wingo (06 Jan 2013 10:16 UTC)
Re: [Scheme-reports] multiple values, and, or, when, unless Jussi Piitulainen (06 Jan 2013 11:14 UTC)
Re: [Scheme-reports] multiple values, and, or, when, unless Jussi Piitulainen (06 Jan 2013 11:46 UTC)
Re: [Scheme-reports] multiple values, and, or, when, unless Jussi Piitulainen (06 Jan 2013 13:12 UTC)

Re: [Scheme-reports] multiple values, and, or, when, unless Andy Wingo 06 Jan 2013 10:15 UTC

Hi Alex,

On Sun 06 Jan 2013 03:34, Alex Shinn <alexshinn@gmail.com> writes:

> On Sun, Jan 6, 2013 at 4:31 AM, Andy Wingo <wingo@pobox.com> wrote:
>
>     as the last expression [of an `and' 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.

I agree it's probably a mistake in practice, but I think that there's no
way you can avoid reducing (or #f (foo)) to (foo) -- and in that case
all values returned from the call to (foo) are returned.

>     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."

I used to agree with you, but requiring the consequent to be in tail
position means that the last expression is evaluated in the continuation
of the "when" expression as a whole.  I don't think you can get around
this with a special "this is unspecified" exception -- you've already
specified it.  Is there any definition other than (if TEST (begin
CONSEQUENT ...)) that actually fits the requirements?

Andy
--
http://wingolog.org/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports