[Top][All Lists]

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

Re: Which Elisp types are mutable?

From: Stefan Monnier
Subject: Re: Which Elisp types are mutable?
Date: Mon, 05 Jul 2021 16:19:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Philipp [2021-07-05 20:40:01] wrote:
>> Am 05.06.2021 um 16:25 schrieb Stefan Monnier via Users list for the GNU
>> Emacs text editor <>:
>>> "You must not mutate them" is the definition of immutable.
>> Not necessarily: where I come from "immutable" means that the object
>> cannot and will not be mutated.
> Then there are no immutable objects, because all objects are stored in
> mutable memory.

You're confusing a language and its implementation.

E.g. ELisp bytecode objects are immutable vectors.  Technically there is
some potential way to mutate them because they're stored in the normal
mutable memory, but efforts were made so that ELisp code cannot
mutate them.

For the same reason, ELisp code cannot "transmute" a marker into an
overlay, even though nothing stops you from doing it at the C level.

> So this definition of "immutable" isn't very useful.

I think most language designers would beg to differ.


reply via email to

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