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: David Kastrup
Subject: Re: copy-sequence no longer copies rings
Date: Fri, 26 Oct 2007 08:22:34 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

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

> 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.

I'd leave the heart out of it.  (nth 2 '(yes no . ask)) barfs, and for
good reason.  There is no sense in assigning a value to a function
that is completely useless for the brain.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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