Andy Wingo <wi...@pobox.com> writes:

> which is strictly unspecified, as it is returning an unexpected number
> of values to a continuation.
>
> Guile 1.8:
>
>     guile> (eqv? (values) (values))
>     #f
>
> Guile 2.0:
>
>     scheme@(guile-user)> (eqv? (values) (values))
>     ERROR: In procedure values:
>     ERROR: Throw to key `vm-error' with args `(vm-run "Zero values returned 
> to single-valued continuation" ())'.
>
> Not a nicely printed error, but oh well.
>
> Guile 2.0 returns a canonical unspecified value in this situation.  I
> would like to consider returning 0 values instead in the future, but
> figuring out how to do so without breaking the world is tricky.  It's
> useful to hear about your experiences with *unspecified*.
>
>> I am working on a language where returning values in certain contexts
>> might at one point of time might lead to the values being used.  So I
>> need to implement warnings to that effect in order to find out calls
>> _not_ returning *unspecified*...
>
> Have you considered using `(values)' as your way of saying, "I'm not
> returning any values"?

Testing for that is not all that much fun.  It is also rather useless
since pretty much all of the call-for-effect functions of Guile return
*unspecified* rather than (values).

It is not clear to me why (values) can't just evaluate to a single
*unspecified* just like '() evaluates to null.  Outside of
call-with-values, I don't see much need to treat it special.

-- 
David Kastrup

Reply via email to