Subject: [DOC] modify literal objects
From: Kevin Vigouroux <[email-masked]>
To: [email-masked]
Date: Thu, 16 Apr 2020 21:28:03 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.