Subject: Re: [DOC] modify literal objects

From: Paul Eggert <[email-masked]>
Date: Sun, 19 Apr 2020 14:02:42 -0700

On 4/19/20 9:59 AM, Mattias Engdegård wrote:
> What about we add a separate section about literals of all types, why they should be treated as immutable even though mutation currently isn't detected or disallowed at runtime, and recommended ways of coping with it (constructor functions, copy-sequence)? It would serve as a point of reference for all sections describing destructive operations.

In my recent patches to the emacs-27 branch I added a section "Constants and 
Mutability" that discusses many of these issues. It's a fundamental topic so I 
put the new section into doc/lispref/objects.texi, and cross-referenced it from 
the destructive-operation sections.

I didn't think of recommending ways of coping with it, and that's a good 
suggestion. I'm not sure that the coping-mechanism discussion belongs in 
objects.texi, though, as it's pragmatic rather than fundamental.

>  There is also a need for some cautionary text in the backquote section.

Yes, my recent patches added a brief note there.

> I'd volunteer to write it all but won't do the work just to have it shot down on general principles.

I know the feeling.