bug-guile
[Top][All Lists]
Advanced

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

Re: (+ (values 1 2)) should be 1


From: Andy Wingo
Subject: Re: (+ (values 1 2)) should be 1
Date: Tue, 24 May 2011 15:11:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Tue 24 May 2011 12:35, Hans Aberg <address@hidden> writes:

> On 23 May 2011, at 15:49, Andy Wingo wrote:
>
>>>> But, it is 1 and 2, currently.  (+ FOO) inlines just to FOO, too
>>>> optimistically.
>>> 
>>> It is unspecified according to rsr5.
>> 
>> I know.  I'm talking about Guile here.
>
> The Guile manual, sec. 10.2.5.2, says that SCM_UNSPECIFIED is to be used when 
> the Scheme standard says the return is an unspecified value.
>
> So this Lisp extension breaks off from that. If one wants it, perhaps, there 
> should be some way to invoke it.

Hans, you are misreading.  (+ 1) is 1 according to the R5RS.  (+ "foo")
is an error.  (+ (values 1 2)) is unspecified, as an instance of
returning an unexpected number of values to a continuation, but it is
not an instance of the unspecified value.

When a continuation that expects one value receives more values than it
is expecting -- e.g., the <> in (+ <>) expects one value -- Guile
truncates those values to the first one.  If such a continuation
receives 0 values, Guile signals an error.

Andy
-- 
http://wingolog.org/



reply via email to

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