[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: %nil once again
From: |
Neil Jerram |
Subject: |
Re: %nil once again |
Date: |
Sun, 19 Jul 2009 19:28:22 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Daniel Kraft <address@hidden> writes:
>>> scheme@(guile-user)> (null? %nil)
>>> #f
>>> scheme@(guile-user)> (equal? %nil (cdr (list 1)))
>>> #f
>>
>> I believe those work in the interpreter, and so are VM bugs. Can you
>> check that with ,o interp #t ?
>
> The first one is indeed #t with the interpreter, the second one
> not. But unfortunatly I think that the elisp equivalent of
>
> (equal?/eqv?/eq? (cdr (list 1)) nil)
>
> (don't know which predicates take the place of eq?/eqv?/equal? in elisp yet)
> should indeed yield true, as a perfectly valid way to check for (null? (cdr
> (list 1))), right? So it seems that in this case even the Guile interpreter
> does not handle empty lists as it should for elisp --
> or don't we need to ensure that test is true?
Hm, interesting point. Is it a problem in practice though? If so,
what is the practical context?
i.e. is there a lot of existing code that uses (equal ... nil) to test
for the end of a list, rather than (null ...) ?
> So no need for ensuring myself that
> all '()'s get replaced by %nil's?
I would say not - because much of the existing Scheme/Elisp design is
based on _not_ having to translate data as it passes between
languages.
Or, to put it another way, if we think that we _do_ have to accept
translating data, I think we could remove lots of special Elisp
support from the libguile core.
Regards,
Neil
- %nil once again, Daniel Kraft, 2009/07/16
- Re: %nil once again, Neil Jerram, 2009/07/17
- Re: %nil once again, Daniel Kraft, 2009/07/17
- Re: %nil once again, Andreas Rottmann, 2009/07/17
- Re: %nil once again,
Neil Jerram <=
- Re: %nil once again, Daniel Kraft, 2009/07/19
- Re: %nil once again, Neil Jerram, 2009/07/19
- Re: %nil once again, Ken Raeburn, 2009/07/19
- Re: %nil once again, Daniel Kraft, 2009/07/20
- Re: %nil once again, Ken Raeburn, 2009/07/20
- Re: %nil once again, Andy Wingo, 2009/07/23
Re: %nil once again, Clinton Ebadi, 2009/07/20
Re: %nil once again, Andy Wingo, 2009/07/23