From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Which Elisp types are mutable? Date: Mon, 5 Jul 2021 20:55:03 +0200 Message-ID: <20210705185503.GD6395@tuxteam.de> References: <87h7ifa932.fsf@mbork.pl> <0404DE66-DD17-41F2-B6CC-EC06937CD152@gmail.com> <874keca73x.fsf@mbork.pl> <70773EA8-6549-4C03-941C-FADAB1BE441A@gmail.com> <8735tw9l14.fsf@mbork.pl> <4AA1E624-B979-4B08-8AE0-E33A1C9A0E94@gmail.com> <834kd8ha0c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/3yNEOqWowh/8j+e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31248"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 05 20:57:38 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0Tmj-0007vv-Kv for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 20:57:37 +0200 Original-Received: from localhost ([::1]:49960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0Tmi-0004dY-Lc for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 14:57:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0TkJ-0002Wk-Jf for help-gnu-emacs@gnu.org; Mon, 05 Jul 2021 14:55:07 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:33234) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1m0TkH-0004Yv-FH; Mon, 05 Jul 2021 14:55:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:Date; bh=pvStL3TBG8qB2pwifJO7wzyZpD3UfLsnluzgtxK3T7A=; b=YL3G4KZvarQdZq7n026hB0ZIWNJ0fQv9cXE75rd/p5Qzw2sZiX3Y+5QrlVyPyCcVkouBhG8M3e7G7SmPASNsUamomB8WYXtvib92IKEQVvoeXugkYaxl+lJkpH+okiitbcw1SV3mJRpHjWOHGvfxG1Fmb6vfyivFA/NQSMAU4E8WhJTkoIjCLGmp91ub52x7gy1XR50+Kt1hQIGNuaPayF1iaYBi0qGNp9NfEErbjU0BTugMKAccuMsKSbJIhOKMm9ESBa8KDLVJHxebZYvHwB1IKJ9nMw8QeVrFgHavA4LUakcojT+D/ab/WQNBsgKgxEYx8vJW5J0GuYeL87ZbAQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1m0TkF-0004qs-2W; Mon, 05 Jul 2021 20:55:03 +0200 Content-Disposition: inline In-Reply-To: <834kd8ha0c.fsf@gnu.org> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131494 Archived-At: --/3yNEOqWowh/8j+e Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 05, 2021 at 09:48:51PM +0300, Eli Zaretskii wrote: > > From: Philipp > > Date: Mon, 5 Jul 2021 20:41:58 +0200 > > Cc: Help Gnu Emacs mailing list [...] > > You can mutate all objects, because all of them are stored in mutable m= emory. >=20 > Not if you put it in read-only memory: you'd get a segfault with any > modern OS. >=20 > > For a reference manual, "you're asking for trouble" isn't a terribly us= eful statement. >=20 > 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 --/3yNEOqWowh/8j+e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmDjVYcACgkQBcgs9XrR2kbvNwCeNsf3wPO3D4MwIMID4DBjLepf SVUAmwRAp+UTRa3ytXiKdDMLaSlgIFf6 =WmAt -----END PGP SIGNATURE----- --/3yNEOqWowh/8j+e--