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: Sun, 17 May 2020 15:39:09 +0300 Message-ID: <00ea7e60-9e47-9fce-52a7-cf66df6e180a@yandex.ru> References: <91857438-f44a-90f4-dfe2-a32224ba3994@yandex.ru> <880dc34b-46a9-0149-3c6e-0a951a70125d@cs.ucla.edu> <9c46b93e-a855-0be0-7ab0-50cb8c5cd74d@yandex.ru> <48e90f87-1519-9101-d54b-4bfd81a0c936@yandex.ru> <252d6368-ddea-2f41-b53f-cd927ebc3d1d@cs.ucla.edu> <43d93102-d361-f64b-971b-909418b89fca@yandex.ru> <2ca64f28-1255-4135-6e45-0f0e12b9e72d@cs.ucla.edu> <0c7570cb-bf52-a617-bf54-27a47c54e04a@cs.ucla.edu> <04298f7d-f2c0-5186-57d3-522e3d886166@cs.ucla.edu> <88af48c6-bc39-6ab0-59ec-7d537f2d375d@yandex.ru> <41d69e2e-561f-743a-e1f0-282b2e22b66c@cs.ucla.edu> <4ba236ce-ade0-5cd1-656a-f2df46d67d5f@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="37578"; 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 , ke.vigouroux@laposte.net, 40671@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Richard Stallman To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 17 14:40:10 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 1jaIaQ-0009ga-Hq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 May 2020 14:40:10 +0200 Original-Received: from localhost ([::1]:36194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaIaP-0005WQ-KP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 May 2020 08:40:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaIaI-0005W8-5W for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 08:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaIaH-0007Yg-Sc for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 08:40:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaIaH-0006Pz-Ps for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 08:40: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: Sun, 17 May 2020 12:40: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.158971916024615 (code B ref 40671); Sun, 17 May 2020 12:40:01 +0000 Original-Received: (at 40671) by debbugs.gnu.org; 17 May 2020 12:39:20 +0000 Original-Received: from localhost ([127.0.0.1]:42521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaIZb-0006Ow-PS for submit@debbugs.gnu.org; Sun, 17 May 2020 08:39:20 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:34774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaIZZ-0006Og-FU for 40671@debbugs.gnu.org; Sun, 17 May 2020 08:39:17 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id y3so8623551wrt.1 for <40671@debbugs.gnu.org>; Sun, 17 May 2020 05:39:17 -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=FQmJYElsViZvtBvU+JNTib5HmXBhZ6XJO3qFw4dsRnk=; b=VCkJIkWj9yfeKQqdlEREZ2VXlW6Q6MvTdxV8RTjbGVAmGO2kZiWaRoLVuBtmc1xdgy SaGmK4pkJogdZhhXTrqUSJIwqA6l4c5zfIHFtzqvabvaGOi259sxwF0fX+18+SDTzLoQ uEvkaMt8iq8lJuJHiZJe6orsbfOfR6RMUM9wvddRkLXB6Ix0uJfPq3xQmzh95T24/Bty 2MEO+HVO3Y5x6rVY/XhCePwEwf9MXJ+Ai3rQWjPsUgIK6Bd5/HlRvEtgFOorB0IlrdFE gwD/G3/0iz7N10c79y54/MBcbGUXc4n1UuYX6Mpap4erluj7Eac4+TQ7Gi0Y2EYzF3HH RIfQ== 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=FQmJYElsViZvtBvU+JNTib5HmXBhZ6XJO3qFw4dsRnk=; b=CU//f8iLzHYwONkIZslrUhMu19eG0dfI6UkVUXGoLbjH7kX4LEePHGBrt0WCLTMbxI RMlnt+0Gg+BF2dIC6JnyHQjTCJyUcfadQmJqVKjiYfzSVnzaXA0jVxlpgFAqqLwSPy7T 2pSRG/8cY5AOFa6ZRbTmjY4OLY/EQH74xNDxleusHH2Xi2TSS4kWM9DeMRIrxyzBPqwk YTEU8yX7GlbOjxANdZq36FQgvTsSP/0OCLQG8/+hb1WlPscWWnvQxF5iTZthhJEhRLON enOSHRA0VAQvfX1i+Yni76RxvU7isfkPDfji3d3g/4AUZCk6c8PO0PHdpRcUMLFEKosZ NWBA== X-Gm-Message-State: AOAM533s4t/3HuEgtMPTozTL7XXkq5CtGc453oqAboIBZlumZiHI4Lee tXnH8DaJd4d0BMF4gVlUADw= X-Google-Smtp-Source: ABdhPJxOjRAv38Ow1Uwv8I97I3Y1EKsuTYfpwwSKMrtaYZUeEZicNEFfjXaN43HYuoMu6ky3kxgvOA== X-Received: by 2002:a5d:46cf:: with SMTP id g15mr15362919wrs.276.1589719151526; Sun, 17 May 2020 05:39:11 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id f127sm12401748wmf.17.2020.05.17.05.39.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 May 2020 05:39:10 -0700 (PDT) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:180454 Archived-At: On 17.05.2020 04:28, Paul Eggert wrote: > On 5/11/20 6:59 PM, Dmitry Gutov wrote: > >> I think that's exactly what a "constraint" means: something that is enforced. > > Not necessarily. In some software systems constraints are not enforced. (Use > Google to search for "unenforced constraints", which can be quite the thing in > the database world.) But I am straying from the documentation issue. An existence of a technical term doesn't really cancel out the regular meaning of the word. >> The symbol-name example? I'm not sure it's really important to >> warn about this one in particular. > > OK, but then you also write: > >> When one tries to >> describe "unsafe" things to do, they don't just give a few examples, they >> usually try to cover all cases. > > ... and symbol-name is one of the cases. These are just two distinct points: 1. You seem to be trying to redefine the term "motable" as a way to avoid enumerating all possible cases. But since the meaning of the term is different from how it is understood in the English language, it should at least have a proper definition. But the said definition would have to cover the possible cases too. 2. symbol-name seems like something we don't have to explain specially. So if that's the only counter-example to "values that appear in expressions", or whichever phrase we chose, then we could as well just on the phrase and dispense with additional complications. Which would also make having a redefinition of the term "mutable" less relevant. > As far as the bigger project (cover all the cases) goes, I don't know how > feasible that would be. I suppose someone could take that on as a further task. > In the attached patch I did add one more example, of calling the copy-sequence > function, but there would be lots more examples where that came from. > >> Inventing a name for such values doesn't help if the user doesn't have enough >> knowledge to avoid all members of this set. Or is "part of an expression that is >> evaluated" after all the test we'll be teaching? > > No, it's not the only way that something can be a constant. This is why the > (symbol-name 'cons) example is relevant: it yields a string that has never been > "part of an expression that is evaluated". There's an argument to be made that the name of the symbol 'cons is part of any expression or program that uses `cons'. >> By the way, I have read last two paragraphs of that section now. C and >> "constants" are still there. > > It's appropriate to talk about constants in the footnote that mentions languages > that have constants. And the footnote is helpful, because it documents the core > issue that prompted this long thread: different languages/traditions mean > different things by the word "constant" and/or "immutable", and the footnote > makes it clear that the documentation's "objects that should not be changed" > follows the Common Lisp / C tradition, not the Python / JavaScript tradition. > > That being said, it'd be helpful if the footnote mentions both "constants" and > "immutable objects" if only to remind readers of relevant buzzwords. So I did > that in the attached patch. I like that change, thank you. >> I'm curious to see the discussion about actually making this error at runtime in >> one of the next Emacs version. > > Me too. That's for a later thread, one that I'd like to get rolling instead of > worrying about the minor details in the current doc. To help get things rolling > I installed the patch that I proposed earlier, followed by the attached minor > patch that attempt to address the abovementioned issues. I plan to look at > improving the runtime checking next. OK, thank you. My intuition, though, that making cases like the one you just changed in emacs-lisp-mode-tests.el blow up at runtime will create a massive backward incompatibility.