Mark H Weaver <m...@netris.org> writes:

> FYI, bipt mentioned this bug on IRC:
>
> <bipt>(compile '(cdr '(5 . #nil)) #:to 'value) => ()
> <bipt>(cdr '(5 . #nil)) => #nil
>
> and I pushed the attached fix to stable-2.0.

Oh, by the way: the Lisp predicate listp (at least Elisp) is

listp is a built-in function in `C source code'.

(listp OBJECT)

Return t if OBJECT is a list, that is, a cons cell or nil.
Otherwise, return nil.

[back]

That is a computationally cheap predicate.  I don't see an equivalent in
Guile: list? checks a narrower condition, and it is O(n) instead of O(1).

Quite often the circularity check is not actually wanted.  Is there
any recommended way to do the equivalent of (or (pair? x) (null? x))?

-- 
David Kastrup


Reply via email to