guile-devel
[Top][All Lists]
Advanced

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

Re: when and unless


From: Ian Price
Subject: Re: when and unless
Date: Thu, 08 Dec 2011 18:10:16 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

David Kastrup <address@hidden> writes:

> So here is another proposal: (values) is not the same as *unspecified*.
> But if you take the first value of a values list in single-value
> contexts, there is nothing about that coercion mechanism that would keep
> you from using *unspecified* whenever that values list would be empty.
This seems like a special case of the, I think, CL behaviour where you
get a nil for each of the values expected that were not explicitly
returned. Not my preference, but certainly not the worst thing you can
do.

(As an aside, people who want this behaviour can use
https://gist.github.com/1359350 which I wrote for dsmith a while back)

> So you would have
>
> (length (call-with-values (lambda () *unspecified*) list)) => 1
> (length (call-with-values (lambda () (values)) list)) => 0
> (eq? (values) *unspecified*) => #t
>
> After all, you will also have
>
> (length (call-with-values (lambda () (values #t #t)) list)) => 2
> (length (call-with-values (lambda () #t) list)) => 1
> (eq? (values #t #t) #t) => #t
>
> and nobody seems all too worried about that, I guess.
Some of us are, I think in the guile community this is a minority
view.

-- 
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"



reply via email to

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