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: Wed, 24 Oct 2007 11:08:20 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

address@hidden (Johan Bockgård) writes:

> Richard Stallman <address@hidden> writes:
>
>> Perhaps we should make `copy-sequence' copy dotted lists.  They are
>> not sequences, but that doesn't necessarily mean `copy-sequence' must
>> refuse to copy them.
>
> XEmacs' version explicitly allows this
>
>     Documentation: 
>     Return a copy of list, vector, bit vector or string SEQUENCE. 
>     The elements of a list or vector are not copied; they are shared 
>     with the original. SEQUENCE may be a dotted list. 

If `copy-sequence' allows for dotted lists, so should `length'.  I am
not sure I like the implications since every list implicitly is also a
dotted list.

To wit:
(copy-sequence '(2 3 . (4 5))) creates an element-wise copy of (4 5)
while (copy-sequence '(2 3 . [4 5])) would not create an element-wise
copy of [4 5].

(length '(2 3 . (4 5))) is 4, while (length '(2 3 . [4 5])) should
presumably be 3.

-- 
David Kastrup




reply via email to

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