[r6rs-discuss] [Formal] Inappropriate number of values should be defined

From: Michael Sperber <sperber>
Date: Tue Jan 23 02:05:58 2007

John Cowan <cowan_at_ccil.org> writes:

> David Van Horn scripsit:
>
>> But `begin' allows that expression to evaluate to zero or more values.
>
> Where in R5.92RS does this statement appear? Not under "begin", and not
> under "values", which is the source of the claim that it's an error to
> pass an inappropriate number of values to any continuation not created
> by call-with-values. There is an ad hoc remark about begin-expressions
> being allowed to return zero or more values in Section 8, which deals with
> expanding macros in top-levele bodies, but nowhere else that I can find.

It's in Section 9.17:

>> The continuations of all non-final expressions within a sequence of
>> expressions in lambda, begin, let, let*, letrec, letrec*,
>> let-values, let*-values, case, cond, and do forms as well as the
>> continuations of the before and after arguments to dynamic-wind take
>> an arbitrary number of values.

The description of `begin' itself also has this possible
implementation, which differs markedly from the one in R5RS:

(define-syntax begin
  (syntax-rules ()
    ((begin exp)
     exp)
    ((begin exp1 exp2 ...)
     (call-with-values
         (lambda () exp1)
       (lambda ignored
         (begin exp2 ...))))))

-- 
Cheers =8- Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla
Received on Tue Jan 23 2007 - 02:05:45 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC