[scheme-reports-wg1] Proposed compromise on #68 "unspecified value(s)" John Cowan 29 Aug 2011 18:16 UTC

Scheme implementers and others have raised the point that whereas R7RS
(following R5RS) requires various syntax forms and procedures to return
"an unspecified value", R6RS allows the freedom to return "unspecified
values", and some implementations may eventually take advantage of this
by returning zero values.

This is not a hugely breaking change for code, but it does break some
code that never expects to deal with any sort of multiple values.  See
http://lists.scheme-reports.org/pipermail/scheme-reports/2011-May/000953.html .
I am therefore proposing that we add the following language to the end
of 1.3.2:

        If a syntax form or procedure is specified as returning an
        undefined value, it is an error to store this value in a
        location or attempt to output it onto a stream.

In this way it becomes impossible to capture the undefined value
in portable code; IOW, the syntax form or procedure can only be invoked in
for-effect contexts such as a body or the inside of a `begin`, `cond`,
`case`, or `guard`.  This means that if the implementation returns
other than one value, it is impossible for portable code to detect it
(other than by wrapping the form in a call-with-values).

Because this issue is under ballot, I have cross-posted the WG1 mailing
list, but directed followups to scheme-reports.

--
Business before pleasure, if not too bloomering long before.
        --Nicholas van Rijn
                John Cowan <cowan@ccil.org>
                    http://www.ccil.org/~cowan