From: Drew Adams <drew.adams@oracle.com>
To: 28627@debbugs.gnu.org
Subject: bug#28627: 24.5; doc of `copy-sequence'
Date: Wed, 27 Sep 2017 13:40:06 -0700 (PDT) [thread overview]
Message-ID: <f340c619-3b86-4687-af74-21a441c127c0@default> (raw)
This (doc string) is not true for an empty sequence:
"Return a copy of a list, vector, string or char-table."
This ((elisp) `Sequence Functions') is not true for an empty sequence:
Storing a new element into the copy does not affect the original
SEQUENCE, and vice versa. However, the elements of the new
sequence are not copies; they are identical (eq) to the elements
of the original. Therefore, changes made within these elements, as
found via the copied sequence, are also visible in the original
sequence.
This has not been true for an empty string since Emacs 23. It is now
the case, for instance that (eq foo bar) here returns t:
(setq foo ""
bar (copy-sequence foo))
(Before Emacs 23 it returned nil.)
Similarly, for []. `copy-sequence' used to give you a new
empty-vector object. Now it does not.
(However, before those changes the same thing did hold for the empty
list, (): copy-sequence did not return a new empty-list object.)
The doc should make clear that there is only one empty-sequence object,
for each type of sequence. In particular, `copy-sequence' does not
create a new sequence object if the sequence is empty.
In GNU Emacs 24.5.1 (i686-pc-mingw32)
of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --prefix=3D/c/usr --host=3Di686-pc-mingw32'
next reply other threads:[~2017-09-27 20:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 20:40 Drew Adams [this message]
2017-09-30 13:04 ` bug#28627: 24.5; doc of `copy-sequence' Eli Zaretskii
[not found] <<f340c619-3b86-4687-af74-21a441c127c0@default>
[not found] ` <<83h8vk49sw.fsf@gnu.org>
2017-09-30 13:44 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f340c619-3b86-4687-af74-21a441c127c0@default \
--to=drew.adams@oracle.com \
--cc=28627@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).