GNU bug report logs - #64960
Documentation for copy-sequence

Previous Next

Package: emacs;

Reported by: uzibalqa <uzibalqa <at> proton.me>

Date: Sun, 30 Jul 2023 16:43:01 UTC

Severity: minor

Fixed in version 29.2

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #44 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, uzibalqa <uzibalqa <at> proton.me>,
 64960 <at> debbugs.gnu.org
Subject: Re: bug#64960: Documentation for copy-sequence
Date: Mon, 31 Jul 2023 07:24:21 +0200
uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> > > When I modify the copy, the original remains intact.
> >
> >
> > No, if you modify an element of the copy, the corresponding element of
> > the original is also changed. That's what "shared" means.
>
> Except for strings

It is irrelevant what happens when you modify elements of a copied
string because it is impossible.  The statement is simply not applicable
to strings.  That's why the docstring only speaks of "list, vector or
record".

Note that substituting a character in a string is not the same as
modifying the character.  You are substituting a sequence element with
another one and not modifying an element in that case.

The same is true for the list (1 2 3) for example.  Exactly the same
situation as for a string: You can replace the number 2 in a copy with
another one but you can't modify the number 2 in the list.  Numbers and
characters are not mutable.

Michael.




This bug report was last modified 1 year and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.