Subject: Re: bug#17474: Making *unspecified* equivalent to (values) would seem convenient

From: [email-masked] (Ludovic Courtès)
Date: Mon, 12 May 2014 21:21:25 +0200

David Kastrup <[email-masked]> skribis:

> [email-masked] (Ludovic Courtès) writes:
>
>> R5RS defines ‘values’ as:
>>
>>      (define (values . things)
>>        (call-with-current-continuation
>>          (lambda (cont) (apply cont things))))
>>
>> Thus, a conforming implementation must raise a run-time error when the
>> continuation of a (values) form expects one or more values.
>
> No.  From R5RS:
>
>  -- procedure: call-with-current-continuation proc
>
> [...]
>
>      The escape procedure accepts the same number of arguments as the
>      continuation to the original call to
>      call-with-current-continuation.  Except for continuations created
>      by the `call-with-values' procedure, all continuations take
>      exactly one value.  The effect of passing no value or more than
>      one value to continuations that were not created by
>      call-with-values is unspecified.

Oh indeed, I stand corrected.

> So this behavior is neither out of line, nor against the standard.  It
> is merely a more convenient behavior for a situation that the standard
> left unspecified.

Right.

I’m not completely convinced it makes sense to “specify” the zero values
case in this way, but I’d like to hear what others think.

Thanks,
Ludo’.