Daniel Kraft <d...@domob.eu> 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