On Sun, Jan 6, 2013 at 7:15 PM, Andy Wingo <[email protected]> wrote: > Hi Alex, > > On Sun 06 Jan 2013 03:34, Alex Shinn <[email protected]> writes: > > > On Sun, Jan 6, 2013 at 4:31 AM, Andy Wingo <[email protected]> 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? >
It's not particularly useful to use when/unless in tail context anyway, so I think we should just remove these from the list of tail calls. But if we do keep it, I see no contradiction stating that the body is a tail context but the result unspecified. -- Alex
_______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
