This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: proposed changes to handling of false and end-of-list
- From: Jamison Hope <jrh at theptrgroup dot com>
- To: "kawa at sourceware dot org list" <kawa at sourceware dot org>
- Date: Thu, 18 Jul 2013 20:36:50 -0400
- Subject: Re: proposed changes to handling of false and end-of-list
- References: <51CE82FC dot 9090209 at bothner dot com> <16EBEA10-7EC3-48A0-A03B-6C845EEE1F91 at theptrgroup dot com> <51E883B7 dot 7090302 at bothner dot com>
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