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 #393 received at 40671 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Drew Adams <drew.adams <at> oracle.com>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Mattias EngdegÄrd <mattiase <at> acm.org>, 40671 <at> debbugs.gnu.org,
 Richard Stallman <rms <at> gnu.org>, ke.vigouroux <at> laposte.net
Subject: Re: bug#40671: [DOC] modify literal objects
Date: Tue, 5 May 2020 04:39:39 +0300
[Message part 1 (text/plain, inline)]
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?
[no_constants.diff (text/x-patch, attachment)]

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

Previous Next


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