[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 <help-gnu-emacs@gnu.org>:
>>> "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.
Stefan
- Re: Which Elisp types are mutable?, Philipp, 2021/07/05
- Re: Which Elisp types are mutable?, Eli Zaretskii, 2021/07/05
- Re: Which Elisp types are mutable?, tomas, 2021/07/05
- RE: [External] : Re: Which Elisp types are mutable?, Drew Adams, 2021/07/05
- Re: [External] : Re: Which Elisp types are mutable?, address@hidden, 2021/07/05
- RE: [External] : Re: Which Elisp types are mutable?, Drew Adams, 2021/07/05
- Re: [External] : Re: Which Elisp types are mutable?, address@hidden, 2021/07/05