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 06:05:22 +0300 Message-ID: <286139d2-bbe1-2d5a-bec1-f781666376f1@yandex.ru> References: <99d7a8f9-7732-e1e3-414e-aabbea4433ac@cs.ucla.edu> <87o8rnasfk.fsf@web.de> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="116818"; 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 05:06:18 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 1jTGZe-000UIG-BY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 05:06:18 +0200 Original-Received: from localhost ([::1]:40484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTGZc-0003F6-DJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Apr 2020 23:06:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47080) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTGZP-0003Dv-Qc for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 23:06:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTGZP-0004s6-AY for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 23:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTGZO-0004qP-Se for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 23:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTGZN-0007sR-Ms for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 23:06:01 -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 03:06:01 +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.158804313330242 (code B ref 40671); Tue, 28 Apr 2020 03:06:01 +0000 Original-Received: (at 40671) by debbugs.gnu.org; 28 Apr 2020 03:05:33 +0000 Original-Received: from localhost ([127.0.0.1]:38549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTGYv-0007rg-BF for submit@debbugs.gnu.org; Mon, 27 Apr 2020 23:05:33 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:34998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTGYs-0007rT-82 for 40671@debbugs.gnu.org; Mon, 27 Apr 2020 23:05:30 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id x18so22840791wrq.2 for <40671@debbugs.gnu.org>; Mon, 27 Apr 2020 20:05:30 -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=sSXphqRCN/jFormBv0QxDEfTM1SvaYtnQkGCFIOVtOY=; b=QbYohH9AdDj73ILYh5XM/5oAzwEEqYJkaCkNWtHV6NNd/MatmxFCjWGIOBnliu6ILM vXisynl8nXskFvfET312WTjhKn8hodZ8XmeMJ54/3TwTuQqR7HTmhq9pqA5MRfgbFMdE MNGgZooKccB9TuVmBBp8/uB+P5EEa0yqTxE6GsnE3oMUnQYgSSq6moM68yr1WHK+Xg/s /rm5P+X0exw0ypBMItdgGlMgi1U0N1xMS/ahzDtjjSXrVWF5LP6TaJsM5TAtTDORAHBb DEQZ8ImRfOt66o7gEJecBKCf4QG4s7/UDlODjd6TNEgzLN/FN4+gu+pkQyMIliosTszg bqUw== 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=sSXphqRCN/jFormBv0QxDEfTM1SvaYtnQkGCFIOVtOY=; b=cUne+Jl99K+9GsYaSpTptUa0L6u4M9JZp9ePtZOyxqJ89dEWztVAPuVPVzxQ5tXiUn sQyCiTGyhz37bEt2lOSKOuHD1d1DmDnPLCLXAS/nYZnI/NPCKHcoOYtgGSnzyquwOa8m uI/7igYo4EyZYeE02ZJ51OSRgamwbnzSNMH29QeBbY9sJg/OnzNU3k85G/udwH5Zqtih 9rtlPfZkPD3n7Ax/th4E3q1Z35MB4JhKena2bAgzawQHFYmQXblDC92rHWthvknkeJ9R XQ5K6ad1vuHkknc/2LLv+0buhqbw38TwmDa+6aKtymG2bU+2uidQmsu8Stzw2uTso40N 77/A== X-Gm-Message-State: AGi0PubYmHB0Dix+avzKfssu2bNT3pqJc6ADlVtD3EUGxhNBlRSw1R07 hP+f5t1dBL3eLk5ePfjOYgg= X-Google-Smtp-Source: APiQypKhRPKQv1lxYMrrUHTldaDxn20YBzvzJMRptngiBiKy3WcaA3znhy2JRmSmxii2N515rUA7yQ== X-Received: by 2002:a5d:6503:: with SMTP id x3mr33675968wru.153.1588043124247; Mon, 27 Apr 2020 20:05:24 -0700 (PDT) Original-Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id h5sm24147160wrp.97.2020.04.27.20.05.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Apr 2020 20:05:23 -0700 (PDT) In-Reply-To: <6d1015da-0dc1-376c-f84b-5e3ee3149213@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:179197 Archived-At: On 27.04.2020 04:49, Paul Eggert wrote: >> Sorry, I don't have an Emacs 26 at hand. Should 25 suffice? > > Yes. > > Just tried this in >> IELM: >> >> ELISP> (setq a '(1 . 2)) >> (1 . 2) >> >> ELISP> (setcdr a 3) >> 3 (#o3, #x3, ?\C-c) >> ELISP> a >> (1 . 3) > > Yes, the behavior is undefined in Emacs 25 too. Undefined means that the > behavior you describe is allowed - in this instance you modified the "constant" > and got away with it. I'm not sure which problematic cases you mean, then. Ones related to pure space? >> In Ruby, we also have "constants" and we sometimes laugh about being able to >> change them. And yet, there also you can't do it by accident. > > I suppose it depends on what one means by "accident". :-) Perhaps we could agree > that accidents, whatever they are, happen more often in C.... It feels like you're just side-stepping the arguments, one after another. >> We better warn against modifying any values that are part of a "literal object" >> anywhere. > > That's what the emacs-27 doc does, or at least tries to do. I wish it did that without inventing new meanings for the words "constant" and "mutable". It will only breed confusion. Take this paragraph: 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.