[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Which Elisp types are mutable?
From: |
Philipp |
Subject: |
Re: Which Elisp types are mutable? |
Date: |
Mon, 5 Jul 2021 20:41:58 +0200 |
> Am 05.06.2021 um 21:19 schrieb Marcin Borkowski <mbork@mbork.pl>:
>
>
> On 2021-06-05, at 14:58, Philipp <p.stephani2@gmail.com> wrote:
>
>>> Am 05.06.2021 um 13:22 schrieb Marcin Borkowski <mbork@mbork.pl>:
>>>
>>>
>>> On 2021-06-03, at 14:11, Philipp <p.stephani2@gmail.com> wrote:
>>>
>>>>> Am 03.06.2021 um 06:03 schrieb Marcin Borkowski <mbork@mbork.pl>:
>>>>>
>>>>> Well, the subject says it all. I could find an explicit, comprehensive
>>>>> list of mutable (or immutable) types in the Elisp manual. Is it there
>>>>> somewhere?
>>>>
>>>> Mutability is a property of objects, not types.
>>>> Some objects (numbers) are always immutable, others (markers, buffers,
>>>> ...) are always mutable. But objects of most "interesting" types
>>>> (strings, lists, vectors, symbols) can be either mutable or immutable.
>>>> Some time ago, I filed https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43557
>>>> to document which objects are mutable, but unfortunately it's not yet
>>>> fixed.
>>>
>>> Thanks. However, I still don't understand. How can a list be
>>> immutable? What about a string? I thought these are _always_ mutable
>>> (although in some cases you must not mutate them, because if you do, bad
>>> things could happen
>>
>> "You must not mutate them" is the definition of immutable.
>
> Well, in my book, "you can't mutate them" is. You always /can/ mutate
> a string, but of you do it in certain circumstances, you're asking for
> trouble.
You can mutate all objects, because all of them are stored in mutable memory.
For a reference manual, "you're asking for trouble" isn't a terribly useful
statement.
- Re: Which Elisp types are mutable?,
Philipp <=
- 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
- RE: [External] : Re: Which Elisp types are mutable?, Drew Adams, 2021/07/05
- Re: [External] : Re: Which Elisp types are mutable?, Emanuel Berg, 2021/07/05