[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: truth of %nil
From: |
Neil Jerram |
Subject: |
Re: truth of %nil |
Date: |
Mon, 29 Jun 2009 22:44:54 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Andy Wingo <address@hidden> writes:
> Hi all,
>
> Daniel came up with an interesting test case:
>
> scheme@(guile-user)> (if %nil 1 2)
> 1
>
> We could fix this transparently by changing scm_is_false in boolean.h
> from:
>
> #define scm_is_false(x) scm_is_eq ((x), SCM_BOOL_F)
>
> to
>
> #define scm_is_false(x) (scm_is_eq ((x), SCM_BOOL_F) || SCM_NILP (x))
>
> I'm not really sure if this is the right place for this to go, though.
> It seems that it is. (Ideally the two values would differ by one bit
> only, and we could mask that bit away and just have the one test.) What
> do people think?
>
> Andy
> --
> http://wingolog.org/
Seems wrong to me. In Scheme #f should be the only false value.
What's the argument for %nil being false in Scheme code?
Neil
- truth of %nil, Andy Wingo, 2009/06/29
- Re: truth of %nil,
Neil Jerram <=