GNU bug report logs - #40671
[DOC] modify literal objects

Previous Next

Package: emacs;

Reported by: Kevin Vigouroux <ke.vigouroux <at> laposte.net>

Date: Thu, 16 Apr 2020 20:40:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


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

From: Kevin Vigouroux <ke.vigouroux <at> laposte.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [DOC] modify literal objects
Date: Thu, 16 Apr 2020 21:28:03 +0200
Hello!

The Emacs Lisp manual often gives the impression that the user can
modify literal lists (e.g. 5.6.1 Altering List Elements with `setcar`).

LISP> (setq x '(1 2))
(1 2)
LISP> (setcar x 4)
LISP> x
(4 2)

However, it is also mentioned that one should not modify the literal
objects because of the byte compilation (c.f. 2.7 Equality Predicate).

Can we modify literal objects?

See Also:

https://emacs.stackexchange.com/questions/45820/when-to-use-quote-for-lists-modifying-quoted-lists-in-elisp
https://emacs.stackexchange.com/questions/57806/which-lisp-objects-are-byte-compiled

Best regards,
Kevin Vigouroux.




This bug report was last modified 5 years and 2 days ago.

Previous Next


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