bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40671: [DOC] modify literal objects


From: Dmitry Gutov
Subject: bug#40671: [DOC] modify literal objects
Date: Tue, 5 May 2020 04:39:39 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 04.05.2020 20:52, Paul Eggert wrote:
Pretty much any ordinary cons will do.  In (let ((x (cons 0 0))) (setcar x 1)),
for example, the cons is referenced from executable code but it's OK to modify
the cons. The cons becomes unreachable when the 'let' finishes. The cons is not
part of any expression that is evaluated.

But, I mean, if we just make it a literal:

(let ((x '(0 . 0))) (setcar x 1))

...it also becomes okay to modify it because the cons becomes unreachable right away. Even so, we strongly recommend against this in the manual now.

When the form above is a part of a function body, however, then it's *really* inadvisable to use the latter option.

The problem here evidently is one of terminology, not of understanding the
underlying issues. When I read "Objects referenced from executable code" I
evidently got a different meaning than what you intended. These things happen
when introducing a new terminology.

I have asked for clarification to try to come up with better phrasing. But to be frank it's not so important to me as fixing the existing one. So if you can find a better option, please be my guest.

In the meantime, what do you think about the attached patch?

Attachment: no_constants.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]