unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Which Elisp types are mutable?
Date: Mon, 5 Jul 2021 20:55:03 +0200	[thread overview]
Message-ID: <20210705185503.GD6395@tuxteam.de> (raw)
In-Reply-To: <834kd8ha0c.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

On Mon, Jul 05, 2021 at 09:48:51PM +0300, Eli Zaretskii wrote:
> > From: Philipp <p.stephani2@gmail.com>
> > Date: Mon, 5 Jul 2021 20:41:58 +0200
> > Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>

[...]

> > You can mutate all objects, because all of them are stored in mutable memory.
> 
> Not if you put it in read-only memory: you'd get a segfault with any
> modern OS.
> 
> > For a reference manual, "you're asking for trouble" isn't a terribly useful statement.
> 
> And "you must not mutate them" is?  At least "you're asking for
> trouble" explains why not, especially if it actually describes some of
> the trouble.

I think putting things into absolute terms is what creates trouble here.
Mutable makes sense wit respect to a language model. In Python, for
example, strings are immutable because the language model doesn't provide
mutating operations. If you write a C library to poke holes in a Python
string, you are extending the language model and thus moving the
goalposts. Your game, have fun :-)

In Emacs Lisp, typical immutable objects are symbols, keywords, numbers
(although bignums technically could be made mutable, I don't think it'd
make much sense :)

Perhaps there are some I missed.

Cheers
 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2021-07-05 18:55 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
2021-07-05 18:48           ` Eli Zaretskii
2021-07-05 18:55             ` tomas [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20210705185503.GD6395@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).