guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: when and unless


From: David Kastrup
Subject: Re: when and unless
Date: Tue, 06 Dec 2011 23:08:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Andy Wingo <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]