[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: |
Wed, 01 Jul 2009 22:54:50 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Daniel Kraft <address@hidden> writes:
> it seems so. Doing just a
>
> scheme@(guile-user)> (if %nil 1 2)
> 1
>
> with a recent build (of at least my elisp branch, but that did not
> change anything in this respect of course) gives that answer.
>
> Doing ,o interp #t as Andy did however also gives the right answer for
> me. BTW, I've just changed my elisp compiler to use real nil instead
> of #f for nil, but now it doesn't have the right semantics of course
> (that's the motivation here).
OK, I see. The point is that VM ops like br-if use SCM_FALSEP (which
is equivalent to scm_is_false), and hence you're wondering if it would
be easier to change the definition of scm_is_false, than to modify
those ops to say (SCM_FALSEP (x) || SCM_NILP (x)).
I think the balance of arguments is clearly against doing that:
- There are lots of places that use scm_is_false where there is no
need to allow for the value being tested being %nil. Changing
scm_is_false would be a performance hit for those places.
- There are only a handful of places (I think) that you need to change
to get %nil-falseness in the VM.
- There is a similar number of places which already implement
%nil-falseness in the interpreter by using (scm_is_false (x) ||
SCM_NILP (x)), and these would logically have to be changed if you
made your proposed change.
- It would be an incompatible API change.
So please just change the relevant places in the VM to say
(scm_is_false (x) || SCM_NILP (x)) instead.
Regards,
Neil
- Re: truth of %nil, Daniel Kraft, 2009/07/01
- Re: truth of %nil,
Neil Jerram <=
- Re: truth of %nil, Mark H Weaver, 2009/07/02
- Re: truth of %nil, Ludovic Courtès, 2009/07/02
- Re: truth of %nil, Neil Jerram, 2009/07/02
- Re: truth of %nil, Mark H Weaver, 2009/07/03
- Re: truth of %nil, Mark H Weaver, 2009/07/04
- Re: truth of %nil, Andy Wingo, 2009/07/05
- Re: truth of %nil, Mark H Weaver, 2009/07/07
- Re: truth of %nil, Mark H. Weaver, 2009/07/08
- Re: truth of %nil, Neil Jerram, 2009/07/06