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: Sat, 2 May 2020 18:42:27 +0300 Message-ID: <37a54ac2-da80-ca35-9c01-38c8e12a4b5f@yandex.ru> References: <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> <8542efe2-c4a6-1da5-2513-7ffcaa6c4ec9@yandex.ru> <293d0eab-4617-08fe-aafa-d6841a750af0@cs.ucla.edu> <4085994e-f42d-b90f-9c86-ad42689bbff2@yandex.ru> <9cfc3b63-7df6-145a-8a78-e3320b6d3861@cs.ucla.edu> <72399223-0ab5-dbe4-5027-d929450a4df0@yandex.ru> <1a2d0454-baa4-9831-0e2c-4411eda1c2fe@yandex.ru> <278a1350-8b9e-4f3b-854a-723d578129f3@default> <6cbe3c10-6d81-f2be-30d7-17096b3f3517@yandex.ru> <012e8bc3-df4b-3884-4e54-5fe7ef4248cb@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="75028"; 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 , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 02 17:43:13 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 1jUuIL-000JQj-P7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 May 2020 17:43:13 +0200 Original-Received: from localhost ([::1]:56810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUuIK-0000M0-QW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 May 2020 11:43:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUuID-0000E0-0K for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 11:43:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUuIA-00026P-9b for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 11:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUuI9-00026I-T5 for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 11:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jUuI9-0004On-Rf for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 11:43: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: Sat, 02 May 2020 15:43: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.158843415816876 (code B ref 40671); Sat, 02 May 2020 15:43:01 +0000 Original-Received: (at 40671) by debbugs.gnu.org; 2 May 2020 15:42:38 +0000 Original-Received: from localhost ([127.0.0.1]:53723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUuHm-0004O8-0D for submit@debbugs.gnu.org; Sat, 02 May 2020 11:42:38 -0400 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:33344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUuHk-0004Nv-71 for 40671@debbugs.gnu.org; Sat, 02 May 2020 11:42:36 -0400 Original-Received: by mail-wr1-f48.google.com with SMTP id h9so5141336wrt.0 for <40671@debbugs.gnu.org>; Sat, 02 May 2020 08:42:36 -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=sjzHWOAshImTAdngIapK9j9vwWiWqbvOh9IsKbs3peI=; b=D9JXrzd4h0l2PkwunJQVTXPLPKcCdsq8LhSSX80byxUIVWJwUQUGKGHa82mEq6xUeF 2cR9Hdx4vsSlRwcAZoSxIbhrJ3qygwLLT55EHze0vvERFnFCrHnh/0/t/bonjdkU9Ou8 3qDjxxGm11gu6odZDwXkHuJGR6hJ9d5cTiN2awjNe4nrfpEA3LGYZBNsW7/bEJr6kRPX NvC2kM6Hs58NwI2ESl5ouOECJGCUmsuhnjZOQ7ZnuWRDKNYFlB2zk2gKCKF583CZubdB 4T9H0FqgbG/g5Nmi1r2/+NiTxns38INKuaMH9C1AP+zWuY4YTsan1FSE3yjXhcjYhirs dbLg== 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=sjzHWOAshImTAdngIapK9j9vwWiWqbvOh9IsKbs3peI=; b=YdqUXsqtxk17TOAJGVKGXlqrzmTxz6xPyXQEW4G+12Pzq6JIyjivlngHtCUTf94tiI XzK1tNYdxBEJfxhwJlyHhnZvrlpqsWZFpbu53HBIyBK4jijyvLBY7yPooS/m9FnA1kJk a9Bg4WElKJihui5Yztp2AXyYHE7pChIqnRBW3NDzMbFag34jNT/v7lKQOWru8kw7Zijq PzGeIxisR9uf1SiVFPgnPslcPGSm0rte1NYa2703K26/vubCsbuIA1Ik5ZTFhGnza03/ /YNB/IyPro2drhYJvdfFXX7j9ksGESaZgGR4i+UwQz+bnPT0oCpDNH2EveC0p8KbKasR 37KQ== X-Gm-Message-State: AGi0Puaps1XcPNqeBbpB7LI7HYQSmAxVep1wdOSX1CfmDr/k3DFa45tc muLtQlJf9e/DNWhXrFKosSk= X-Google-Smtp-Source: APiQypKRWWpRvO441wy9X0R6OWA34vk6aRJFxDwND35TXiqAXL5EDDMcQPSVRdqjzDtihnG6CYndOQ== X-Received: by 2002:a5d:49cb:: with SMTP id t11mr9737232wrs.91.1588434150274; Sat, 02 May 2020 08:42:30 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id 36sm10181989wrc.35.2020.05.02.08.42.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 May 2020 08:42:29 -0700 (PDT) In-Reply-To: <012e8bc3-df4b-3884-4e54-5fe7ef4248cb@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:179520 Archived-At: On 02.05.2020 09:28, Paul Eggert wrote: > On 5/1/20 6:07 PM, Dmitry Gutov wrote: > >> They very rarely use the phrase "constant objects", however. Instead, it's >> almost always "objects that appears as a constant [in code]", "object ... used >> as a quoted constant", "object may not ... appear as constants in code", >> "objects are similar as a constant". > > We could use similar circumlocutions. Or instead of saying "constant" we could > say "unchanging", as distinct from "unchangeable". (It beats > "object-that-should-not-be-changed" or "glass object - you changed it, you broke > it!". :-) The usual word for this notion is "constant", though. "glass objects" or "voldemort objects" all sound better to me. :-) "unchanging" is one of the meanings of "constant". It's a property of a process, not something we can call a value out of context. CLtL uses the term "coalesced", though. We can consider it. >> IOW, it's the difference between constant values and constant pointers to >> [mutable] values. > > I don't see that. A constant (or "unchanging") string is like a mutable string, > except you shouldn't change it. An unchanging string is just a string that nobody changed. "Please don't change unchanging strings" is a prohibition of time travel. > There's no sense in CLtL in which a mutable > object must be implemented via a pointer to a value whereas a constant must not > be implemented that way. The "objects that appear as a constant" are objects to which exist references from executable code, and where such references are "constant" (or possibly constant, since an implementation might opt not to coalesce the values). That why it's about constant references (and objects to which such references exist). >> there is no juxtaposition of "mutable objects" vs "constant objects" >> anywhere in there > > Yes, the mutable/immutable terminology revolution happened mostly after CLtL was > written. Not just because of that. >> So the section >> "Constants and Mutability", even though it has valuable information, could use a >> full rewrite. And could probably move to end of the "Self-Evaluating Forms" >> section. > > Whether an object is constant is distinct from whether it's derived from a > self-evaluating form, because one can have constants that were never derived > from any self-evaluating form. Examples? I mean, A mutable object can become constant if it is part of an expression that is evaluated does add some cases not covered by self-evaluating forms, but those are more complex cases (e.g. creating forms programmatically and then passing them to 'eval'), and then the programmer might justifiably be expected to use their head. The self-evaluating forms case is arguably less obvious.