From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#40671: [DOC] modify literal objects Date: Tue, 28 Apr 2020 16:54:45 +0300 Message-ID: <8542efe2-c4a6-1da5-2513-7ffcaa6c4ec9@yandex.ru> References: <9e6c138d-cb9f-6075-34df-a8d1d931343b@cs.ucla.edu> <871rofxbz9.fsf@web.de> <93463227-33a8-85a0-fd19-8b29b75997f3@yandex.ru> <969b3497-0afd-d104-6792-d744d31548fa@cs.ucla.edu> <2935ec84-bdea-2e20-01b9-8ed08cc61c6c@yandex.ru> <669981e5-f601-5c18-1a8b-ee316ad001ec@cs.ucla.edu> <4b8b7e98-029e-58ac-59ff-6cd984b7eb85@yandex.ru> <530d3597-aaaa-f019-bafa-8229d13e7248@yandex.ru> <60b88f52-c50d-c57a-9ce5-495e6157d36e@cs.ucla.edu> <0721d8c1-4fe3-335c-7dbc-171487cb648a@yandex.ru> <6d1015da-0dc1-376c-f84b-5e3ee3149213@cs.ucla.edu> <286139d2-bbe1-2d5a-bec1-f781666376f1@yandex.ru> <10b89e6f-6fa6-f855-65b6-3361a74472d3@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="55413"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: Michael Heerdegen , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , ke.vigouroux@laposte.net, 40671@debbugs.gnu.org, Richard Stallman To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 28 16:04:21 2020 Return-path: Envelope-to: geb-bug-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 1jTQqT-000EIq-56 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 16:04:21 +0200 Original-Received: from localhost ([::1]:58944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTQqR-0001So-UN for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 10:04:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39548) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTQlp-0000MW-6Z for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 10:04:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTQhT-0007Nk-BS for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 09:59:32 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTQhS-0007Nc-Uk for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 09:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTQhS-0001Jv-QT for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 09:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Apr 2020 13:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40671 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40671-submit@debbugs.gnu.org id=B40671.15880820985057 (code B ref 40671); Tue, 28 Apr 2020 13:55:02 +0000 Original-Received: (at 40671) by debbugs.gnu.org; 28 Apr 2020 13:54:58 +0000 Original-Received: from localhost ([127.0.0.1]:39366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTQhO-0001JV-4C for submit@debbugs.gnu.org; Tue, 28 Apr 2020 09:54:58 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:36685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTQhK-0001J3-Mo for 40671@debbugs.gnu.org; Tue, 28 Apr 2020 09:54:57 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id u127so2970004wmg.1 for <40671@debbugs.gnu.org>; Tue, 28 Apr 2020 06:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IYzdIbCHyG7hwkEbF/v0BzdTN1c4MJ0j+DECzaNF948=; b=Mgm4A4CceBP6kZipI+0QoWEyrSoPSaAcOb4u1Of/UiFzwcwozFLnwLimwQPVFvlOuP A+hyKdLcWJTZ79O7qpRbP6jk1G8EmW2wP83tXlmtQZOuJf+uUhk56SpPujlVyoCSWko5 6jmkbLOdX5Vv2L4NyX/6ly46sS27bKTT4lkuVOoIc7bKh8uouZ18mkJ593Zt4VCPnHsf bcz9xtEJTxZJ4R7t0EQlHycG7e1xWK5sS+rrnXuIbF3+3INMwM0diZg3sp42OwQwrMEB zugdVJaSXEGmOR1RzFXo0rexOmHAoHvDB1QyLyIXAhylAKXrPx6sSMrpJec1cbuKYvuJ GDSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IYzdIbCHyG7hwkEbF/v0BzdTN1c4MJ0j+DECzaNF948=; b=M+uyHSp10Towj8UjfkMM+rTRTUSwKdH8Hj2+NMiyNCgJ5nUt1ZVfQDapl5CVGpwBgY vX+Ku5M5rgHy1yvsjAVCMaSqOYrviD2wVtOBRDcUbtHbZX0ehoWk0WsC8/TtIbYJOpoU GKdlheiL+mNMrPmko05/F6gaF3nvlVLyuhLHmCSraA9UuHkqdweIG6poSd74MP0CYMYS WE39+CWxroJzdDRi6+FDth7PcQ+dyQLWjOiHTqC3KargK6iZKPyEfGD6uLpXCGqgU22n Sr7GgwJn9pFT3CFPFLgbvyMKz5BO4s/YFeiZZ/MPeAL9bIkxSLikeuv/5zPaO90pKVZR IKXA== X-Gm-Message-State: AGi0PubdDh5qfIn0UcngL5qGAJhYOdaokQxcCyjQP43m3rX+CVGuZDAv Vqbl63eQ4dS6oNviUwp8Ofo= X-Google-Smtp-Source: APiQypLzr+bvqKUagyQ3M87qTOHsdYDBZ3UuwnFka715OtexRWp1NDnjNcvX84As46nukb8EK/yfvw== X-Received: by 2002:a05:600c:4102:: with SMTP id j2mr5042858wmi.159.1588082088580; Tue, 28 Apr 2020 06:54:48 -0700 (PDT) Original-Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id r3sm26691111wrx.72.2020.04.28.06.54.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Apr 2020 06:54:47 -0700 (PDT) In-Reply-To: <10b89e6f-6fa6-f855-65b6-3361a74472d3@cs.ucla.edu> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179215 Archived-At: On 28.04.2020 11:17, Paul Eggert wrote: > On 4/27/20 8:05 PM, Dmitry Gutov wrote: > >> I'm not sure which problematic cases you mean, then. Ones related to pure space? > > That's one issue. Earlier versions of Emacs also had trouble if you modified > list structures while executing them. I've squashed some of those issues more > recently but would not be surprised if some remain. If any led to segfaults, they have to be fixed in the code anyway. > I don't know how much optimization the byte compiler did in earlier versions, > but if it did anything like what it does now, that's also a source of problems. Well, here's a damning example. And it doesn't involve the byte compiler: ELISP> (defun abc () "abc") abc ELISP> (aset (abc) 0 ?b) 98 (#o142, #x62, ?b) ELISP> (abc) "bbc" I wonder how other Lisps deal with that. The Ruby interpreter, from the first release I think, always created copies of the literals when a method was called. Exactly to avoid this kind of broken semantics. In the recent versions, they added a pragma string (to be added to the top of the file) that makes all such literals in that file "immutable". That means that any attempt to change them errors at runtime. And now it's considered good style to use that pragma everywhere. >>     Although all numbers are constants and all markers are >>   mutable, some types contain both constant and mutable members.  These >>   types include conses, vectors, strings, and symbols.  For example, the >>   string >>   literal @code{"aaa"} yields a constant string, whereas the function >>   call @code{(make-string 3 ?a)} yields a mutable string that can be >>   changed via later calls to @code{aset}. >> >> It makes one think that 'aset' can't be called on "aaa". That it will either >> fail to change the value, or signal an error. Whereas the result is that the >> value is changed, no errors or warnings. > > 'aset' *shouldn't* be called on "aaa". Indeed it shouldn't. > We could replace "a constant string" with "a constant string that should not be > changed"; would that help? That sounds like a weird tautological non-advice. It shouldn't be changed because it's a value of a string literal. Not because it's constant (it isn't). >> It feels like you're just side-stepping the arguments, one after another. > > There's certainly no intent to side-step. And I don't sense that there's really > much disagreement here: we both agree that the current behavior is unfortunate, > the major point of disagreement is about terminology in the documentation. From the outset all arguments were about the terminology.