emacs-devel
[Top][All Lists]
Advanced

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

Re: 31395511: "Don’t attempt to modify constant strings"


From: João Távora
Subject: Re: 31395511: "Don’t attempt to modify constant strings"
Date: Sat, 06 Jun 2020 00:19:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> FWIW, it's a non-intuitive limitation for me as well.
>
> But you can give bug#40671 a read, so see some context you might be missing.

Thanks, that's a pretty long read.  There is indeed a relation, but that
bug (the first parts) is about modifying literal objects and this
particular strangeness seems bigger than that. I totally agree it is
undefined behaviour to change structure of literals (quoted or
self-evaluating objects), also in Common Lisp, because compilers are
probably allowed to reuse parts of the internal structure of such
objects.  But that's a far cry from having two different manifestations
of `equal` such objects _be_ the same object, but only for compiled
code.  Emacs doesn't behave that way for quoted lists (fortunately), so
I don't think it should behave that way for strings either.

An "easy" solution would be to say: in Elisp, there are no string
literals, period, because properties.  But that's likely expensive...
unless some clever copy-on-write semantics operate under the hood.  But
I'm talking out of my elbow, I don't really know what's under the hood
here.

João








reply via email to

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