From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#40671: [DOC] modify literal objects Date: Thu, 23 Apr 2020 02:49:30 +0200 Message-ID: <871rofxbz9.fsf@web.de> References: <83tv1finob.fsf@gnu.org> <1E9E4C19-37C2-4E24-91B7-8101F9CFBF35@acm.org> <527dc4b5-3176-38b5-f2c1-1483ffc814a1@cs.ucla.edu> <87k12b6sv2.fsf@web.de> <2225099d-16e1-645d-0342-a054da53363f@cs.ucla.edu> <87a7376nv9.fsf@web.de> <99d7a8f9-7732-e1e3-414e-aabbea4433ac@cs.ucla.edu> <87o8rnasfk.fsf@web.de> <9e6c138d-cb9f-6075-34df-a8d1d931343b@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="62589"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 40671@debbugs.gnu.org, ke.vigouroux@laposte.net To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 23 02:51:58 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 1jRQ5u-000GCQ-Mo for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Apr 2020 02:51:58 +0200 Original-Received: from localhost ([::1]:59990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRQ5s-0005hO-Kh for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 20:51:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49874) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRQ51-0005hI-Er for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 20:51:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRQ50-0007Pa-PZ for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 20:51:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRQ50-0007PO-EI for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 20:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRQ50-0005fw-AU for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 20:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Apr 2020 00:51: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.158760300121710 (code B ref 40671); Thu, 23 Apr 2020 00:51:02 +0000 Original-Received: (at 40671) by debbugs.gnu.org; 23 Apr 2020 00:50:01 +0000 Original-Received: from localhost ([127.0.0.1]:53643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRQ41-0005dz-B0 for submit@debbugs.gnu.org; Wed, 22 Apr 2020 20:50:01 -0400 Original-Received: from mout.web.de ([212.227.15.14]:39879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRQ3y-0005dk-SQ for 40671@debbugs.gnu.org; Wed, 22 Apr 2020 20:49:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1587602970; bh=/kuEyfdVr3zPu4IWLS/q0il/jz+UWAhtUMU/bn5gfHA=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=TFOow9cLn4Y78/e6RwazPjqw0IsNw4xS0VwZ/RVx8EHjIK+AYzEf2M8vJ4KQ2383Y /Br3NBuB2xiyMyeQH5LofcaSmtD77SuTytjmwynAQSrTDQJVFkA37gfhSay58o4Mag 8SJQ+HxzGGQYsSuG/mET3YTKo2JY9dbWPKmK44TI= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([188.98.99.7]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LtXDY-1j1sQn3dky-010qgz; Thu, 23 Apr 2020 02:49:30 +0200 In-Reply-To: <9e6c138d-cb9f-6075-34df-a8d1d931343b@cs.ucla.edu> (Paul Eggert's message of "Wed, 22 Apr 2020 10:21:51 -0700") X-Provags-ID: V03:K1:85XZt36pLKj+CLSDQAVC21MeMTjuLl2rlSgnHlIMU9YpDgYbrzu +UtINO3zKlcDrNTsO2ojeFEjHsXJRn6j7RhVibrmROy8mPTNQNtRPUfU6E2tXgURlTNEELo k9zU9IBB7lEHEmoS1HbYLFNvT6I9yz3SnoDAdRJqyBl5WSfkBBpnjdqm8vokL6yKuLVHf48 Xk3MAmJUqDOEgPU80y0nA== X-UI-Out-Filterresults: notjunk:1;V03:K0:uRImqVldqmM=:YLcD4uLIG2TCC8zMoXozi8 0v4d/45E6ney3A10IQtomlSr6HMiPyJiqM06KMswAhOlkIvfabK7HWmChJy8GgTzioCs3w2hI WlDpveNW6rRbo8vPYWhrqDJ37mdUGI2ot5pLZ6wkDQGRc6d1TKCoC/kPED8odS2SG6KVWk2Yk WdZVUbhSkf1yfzrAVXvD8qYbl4xjHcWudoDnNcf09nKrQ4PeVoJrhLuTbnauZBWtNaPzduWHz 6N5FWB8dpk8c3coffMA577YHkQACtKGIzpMzestcJIA095/8b1X76GJ7iMrWb5dvQPGwl4OnV OGcknOgv8hXEKXXVvWBaZPgLj4tJ76L4mWJiA8n8E8EiqsuuFSRQ2Ue+FKvAB6a/fADejSsdz d/OnK521TdPNUu4EHvT/uM9npG8Xmrwz2jGhVxkTDngJwp9K3XpibppGL7xmIbPrgn2uHneiS qwrioRrKj6yzUbP6wrZa+4rGs8QYAu83JLJULybMIfw7VXK0mFvLBZ1IOEHJAZgFqwnps4xH2 +29Lt4dAetsb+99V50rPJCR6BluoaKfI4DboLyKhiwy8cSERqEy0DRqpMcgY2gwbzfDWukoaQ Jem/iqqi/2+X3CgKKuSKPYSEGYtdhX2kpKsu0n4EPP1mQZ+ifIZtjIozChe78MUp+wIYd+HBo Uwd5B03pBS0aDDMF9TblwVxToPiT0dunALmTdXbywEV+ol0IKqCNUdA/kVo54ofZ9BrWU+1qp Rg4SAFInoEMNvC1cwVmhkMXjJi3spyBWYXfnX5uID/bO5T5UeN+HMI3h5ZXrLnQvvQVoERTa 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:178839 Archived-At: Paul Eggert writes: > > A mutable object cannot be changed to a constant > > Sure they can. This idea is common in other languages, e.g., see > Object.freeze method in JavaScript. There's no reason Emacs Lisp can't > use the idea. Ok. I still have questions and objections about your additions: + A mutable object can become constant if it is passed to the +@code{eval} function, because you should not modify an object that is +being or might be executed. The reverse does not occur: constant +objects should stay constant. `eval' is used quite rarely. Can what you describe happen under other circumstances, or does it only happen to `eval'? E.g. what about this case for example: (let ((l (list 1 2 3))) (funcall (lambda () l))) Has the list become a constant? I ask because the sub-clause "because you should not modify an object that is being or might be executed" is totally different statement than that about `eval'. A list literal (1 2 3) or a string as in the example in your answer to Drew are surely not executed, as they are not valid forms. They are part of a program. But anything a macro generates also becomes part of a program. Maybe I misread "might be executed" as "might be executed in the future" and you actually meant something like "might (currently) be executed (as part of the expression the interpreter currently executes). BTW, speaking about Lisp the term "evaluate" is probably preferable to "execute" I think. Thanks, Michael.