unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* truth of %nil
@ 2009-06-29 21:12 Andy Wingo
  2009-06-29 21:44 ` Neil Jerram
  0 siblings, 1 reply; 38+ messages in thread
From: Andy Wingo @ 2009-06-29 21:12 UTC (permalink / raw)
  To: guile-devel

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/




^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2009-09-20 21:36 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-29 21:12 truth of %nil Andy Wingo
2009-06-29 21:44 ` Neil Jerram
2009-06-29 22:11   ` Andy Wingo
2009-06-30 22:22     ` Neil Jerram
2009-07-01  6:45       ` Daniel Kraft
2009-07-01 21:54         ` Neil Jerram
2009-07-05 13:07           ` Mark H Weaver
2009-08-30 11:07             ` Neil Jerram
2009-08-30 14:11               ` Mark H Weaver
2009-09-01 22:00                 ` Neil Jerram
2009-09-02 15:57                   ` Mark H Weaver
2009-09-17 21:21                     ` Neil Jerram
2009-07-02 14:28   ` Mark H Weaver
2009-07-02 14:50     ` Ludovic Courtès
2009-07-02 22:50     ` Neil Jerram
2009-07-03 15:32       ` Mark H Weaver
2009-07-05  2:41         ` Mark H Weaver
2009-07-05  9:19           ` Andy Wingo
2009-07-07 11:14             ` Mark H Weaver
2009-07-08 13:17               ` Mark H. Weaver
2009-08-30 11:20                 ` Neil Jerram
2009-08-30 11:13               ` Neil Jerram
2009-08-30 14:15                 ` Mark H Weaver
2009-09-01 21:50                   ` Neil Jerram
2009-08-30 22:01                 ` Ken Raeburn
2009-08-31 21:59                   ` Ludovic Courtès
2009-08-31 23:39                     ` Ken Raeburn
2009-08-31 21:55                 ` SCM_BOOL_F == 0 and BDW-GC Ludovic Courtès
2009-09-17 22:00                   ` Neil Jerram
2009-09-17 22:28                     ` Ludovic Courtès
2009-09-18 20:51                       ` Neil Jerram
2009-09-20 17:21                         ` Ludovic Courtès
2009-09-20 21:03                           ` Neil Jerram
2009-09-20 21:36                             ` Ludovic Courtès
2009-07-06 21:46           ` truth of %nil Neil Jerram
2009-07-06 23:54             ` Mark H Weaver
2009-07-08  8:08             ` Ludovic Courtès
2009-07-23 21:12         ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).