[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue: TAILP-NIL



I've been putting this issue in the status list, but had never mailed it
out. It is not yet in proper format. 

For the record:


Issue: TAILP-NIL
Reference: Steele p.275
Category: clarification
Description:
The description of tailp in Steele differs from current implementations
in the case where the first argument is NIL. In particular, the second
sentence "Another way to look at this is tailp is true if (nthcdr n
list) is sublist, for some value of n." does not accurately describe
current practice for the case where sublist is nil.
The behavior of TAILP on circular structures is also unspecified, e.g.,
is  (tailp '() '#0=(x . #0#)) meaningful?

Proposal: TAILP-NIL:RETURN-NIL

Clarify that (TAILP NIL X) returns NIL for all lists X, and that tailp
must be true-false-indeterminate equivalent to 
(defun tailp (x y)
   (and x y (or (eq x y) (tailp x (cdr y)))))

i.e., if the second argument is circular and the first argument is not a
"tail" of the non-circular part of it, tailp may loop indefinitely.