This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: proposed changes to handling of false and end-of-list


On Jul 18, 2013, at 8:09 PM, Per Bothner <per@bothner.com> wrote:

>> I would probably go one further and argue that not only should #!null
>> be false, so should #!void.
> 
> I'm reluctant for a couple of reasons.  Mainly, Kawa treats #!void
> as equivalent (though not necessarily eq?) to the result of (values).
> I.e. #!void is zero values.  It is not clear that zero values
> should be false.  I think a zero-length tuple is true.

#!void == (values) was precisely my reasoning.  This whole thing
started with a desire to be more compatible with Lisp, right?

In CL if a continuation expects more values than are provided,
then the extra values are filled in with NIL:

> * (multiple-value-bind (a b) (values 1) (list a b))
> 
> (1 NIL)


So in particular, when (values) is used in a context expecting
one value, it evaluates to false:

> * (if (values) 'true 'false)
> 
> FALSE

(Those were evaluated in SBCL.)

--
Jamison Hope
The PTR Group
www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]