# can (values) be the (an) unspecified value?

   Date: Thu, 3 Feb 94 20:21:49 -0500
From: Jonathan Rees <jar@martigny.ai.mit.edu>

Date: Thu, 3 Feb 94 16:18:16 -0500
From: Guillermo J. Rozas <gjr@martigny.ai.mit.edu>

Does this mean that the implicit continuations in a begin accept 0 or
1 return values, or that you must write silly things like the
following?

(begin
(call-with-values
(lambda () (set! x 3))
(lambda () 3))
...)

I was under the impression that we all agree that non-final forms in a
begin (or implicit begin) can deliver any number of values, e.g.
(begin (values) (values 1 2 3) 7) is OK, and that if this was omitted
from the approved multiple value proposal, it was an oversight.
And the editor is advised to make it all clear in the report, etc.
The formal semantics already allows it, so no change is needed there.

I'm afraid to ask -- there aren't any objections, are there?

Attached is the last version of the proposal that I saw (extracted
from an 18 May 1992 message).  It does not mention any special
handling of "intermediate" BEGIN continuations.  In fact, the
following is from the report on the R5RS meeting of 25 June 1992:

Brief discussions of three issues then yielded a consensus:

Multiple values:  Dan Friedman stated that he understood the
motivations to be efficiency and a wish to hide representations.
The multiple values proposal was then adopted without objection.

I may very well have missed or forgotten something, but I don't recall
anything of the form that you suggest.

I don't object to letting "intermediate" BEGIN continuations to accept
(actually discard) any number of values, since I always defended this,
together with allowing other implicit continuations to accept more
than 1 value without complaining.

However, other people in the community objected earlier.  I would like
to know what the current status is.

----------------------------------------------------------------------

%%% Multiple values compromise proposal of December 4, 1989.
%%% This is raw TeX.
\def\mvcall{call-with-values}
\def\mvcontinue{values}

The editors are directed to add text to R$^5$RS so as to include the
procedures {\tt \mvcontinue{}} and {\tt\mvcall{}} consistent with the
following definitions.  The {\tt \mvcontinue{}} procedure takes any
number of arguments, and simply passes them to its continuation.  The
{\tt\mvcall{}} procedure takes a thunk and a procedure, and calls the
thunk with a continuation that, when passed some values, calls the
procedure that was the second argument to the {\tt\mvcall{}} procedure
with those values as arguments.  Except for continuations created by
the {\tt\mvcall{}} procedure, all continuations take exactly one
value, as now; the effect of passing no value or more than one value
to continuations that were not created by the {\tt\mvcall{}} procedure
is unspecified (as indeed it is unspecified now).
Suggested formal semantics:
$$\hbox{\it \mvcontinue{}} = \lambda\epsilon^*\kappa . \kappa\epsilon^*$$
$$\hbox{\it \mvcall{}} = \hbox{\it twoarg }(\lambda \epsilon_1 \epsilon_2\kappa . \hbox{ \it applicate } \epsilon_1 \langle \rangle \lambda \epsilon^* . \hbox{ \it applicate } \epsilon_2 \epsilon^* \kappa)$$

\end