emacs-devel
[Top][All Lists]
Advanced

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

Re: copy-sequence no longer copies rings


From: Stephen J. Turnbull
Subject: Re: copy-sequence no longer copies rings
Date: Fri, 26 Oct 2007 15:02:33 +0900

David Kastrup writes:

 > "Stephen J. Turnbull" <address@hidden> writes:

 > > I don't see the problem.  `(2 3 . (4 5))' is just notation; the
 > > structure is `(2 . (3 . (4 . (5 . nil))))'.

 > Yes, that is the point.  It's just notation.  So what is the principal
 > difference between a cdr that is a list, and a cdr that is a non-list
 > cons cell?  Or should every cons cell be called a list?

No.  I think you're missing the point; we're talking about sequences
here, not lists.  Of course, a cons cell is a list if and only if (a)
its cdr is nil or (b) its cdr is a list.  Nobody proposes to change
that.

The proposal here is to allow all cons cells to be heads of sequences.

 > (copy-sequence '(2 . (3 . (4 . (5 . nil))))) copies every dotted pair
 > recursing on the cdr, to a total of 4 dotted pairs.
 > 
 > So what should (copy-sequence '(2 . (3 . (4 . 5)))) copy?  3 dotted
 > pairs?  Probably.  But then it would appear logical if the "length"

Logical, yes, but the heart, too, has its reasons.  My heart says that
(yes no . ask)) is a triple, and that its length is 3.

It's not clear to me that this is a good idea, since dotted lists
can't be distinguished from proper lists without following up to the
end (eg with true-list-p).  But by the same token it's not obvious to
me that giving length a value for a dotted list is harmful.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]