guile-devel
[Top][All Lists]
Advanced

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

truth of %nil


From: Andy Wingo
Subject: truth of %nil
Date: Mon, 29 Jun 2009 23:12:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

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/




reply via email to

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