all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp <p.stephani2@gmail.com>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: Which Elisp types are mutable?
Date: Mon, 5 Jul 2021 20:41:58 +0200	[thread overview]
Message-ID: <4AA1E624-B979-4B08-8AE0-E33A1C9A0E94@gmail.com> (raw)
In-Reply-To: <8735tw9l14.fsf@mbork.pl>



> 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.


  parent reply	other threads:[~2021-07-05 18:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  4:03 Which Elisp types are mutable? Marcin Borkowski
2021-06-03 12:11 ` Philipp
2021-06-05 11:22   ` Marcin Borkowski
2021-06-05 12:58     ` Philipp
2021-06-05 14:25       ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-05 18:40         ` Philipp
2021-07-05 20:19           ` Stefan Monnier
2021-07-05 20:44             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 20:58               ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-05 21:03                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-05 19:19       ` Marcin Borkowski
2021-06-05 20:17         ` [External] : " Drew Adams
2021-06-05 20:36           ` Dmitry Gutov
2021-06-06  1:57             ` Drew Adams
2021-07-05 18:41         ` Philipp [this message]
2021-07-05 18:48           ` Eli Zaretskii
2021-07-05 18:55             ` tomas
2021-07-05 19:26               ` [External] : " Drew Adams
2021-07-05 19:40                 ` tomas
2021-07-05 20:03                   ` Drew Adams
2021-07-05 20:12                     ` tomas
2021-07-05 20:39                       ` Drew Adams
2021-07-05 20:58                         ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AA1E624-B979-4B08-8AE0-E33A1C9A0E94@gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@mbork.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.