guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple return values


From: Marius Vollmer
Subject: Re: multiple return values
Date: 06 Aug 2001 00:15:51 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Neil Jerram <address@hidden> writes:

> >>>>> "Matthias" == Matthias Koeppe <address@hidden> writes:
> 
>     Matthias> Marius Vollmer <address@hidden> writes:
>     >> 
>     >> The question is now, do we want to allow ignoring superflous
>     >> values, or should that be an error.  I'm in favour of allowing
>     >> them to be ignored.
> 
>     Matthias> I think it is a bad idea because it encourages writing
>     Matthias> non-portable code: R5RS (Control Features) says that
>     Matthias> "Except for continuations created by the
>     Matthias> `call-with-values' procedure, all continuations take
>     Matthias> exactly one value."  Clinger also calls this situation
>     Matthias> (passing multiple values to single-value continuations)
>     Matthias> an error in his posting.  Hence, your proposed change
>     Matthias> does not make the m-v implementation more "correct".
>     Matthias> [...]
> 
> I agree with Matthias.

I see.  What about having `values*' in addition to `values', where
`values*' would throw away extraneous return values?

> Doesn't this boil down just to a `multiple_value_continuation_p' local
> variable on the stack in the evaluator, which is initialized to 0 but
> set to 1 by the code that handles `call-with-values'.  Then, as long
> as we've got tail recursion right, multiple_value_continuation_p will
> remain set for any context that is in tail position with respect to
> the `call-with-values' expression.

Yes, but the producer is not called in a tail-position.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]