From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#40671: [DOC] modify literal objects Date: Fri, 24 Apr 2020 19:22:22 -0700 Organization: UCLA Computer Science Department Message-ID: 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> <871rofxbz9.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------6E97AB9219D2496F0B390A35" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="90604"; 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: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 40671@debbugs.gnu.org, ke.vigouroux@laposte.net To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 25 04:23:12 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 1jSATI-000NTZ-G0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 04:23:12 +0200 Original-Received: from localhost ([::1]:56682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSATH-0006Rc-HS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Apr 2020 22:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57562) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSAT9-0006R0-Je for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 22:23:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSAT9-0006OP-1u for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 22:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSAT8-0006OJ-Kk for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 22:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jSAT8-0000QW-HD for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 22:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Apr 2020 02:23: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.15877813501581 (code B ref 40671); Sat, 25 Apr 2020 02:23:02 +0000 Original-Received: (at 40671) by debbugs.gnu.org; 25 Apr 2020 02:22:30 +0000 Original-Received: from localhost ([127.0.0.1]:58298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSASc-0000PR-ID for submit@debbugs.gnu.org; Fri, 24 Apr 2020 22:22:30 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSASb-0000PD-4B for 40671@debbugs.gnu.org; Fri, 24 Apr 2020 22:22:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C797F16008D; Fri, 24 Apr 2020 19:22:23 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id VIS62eHtc7LI; Fri, 24 Apr 2020 19:22:22 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DEAE41600D3; Fri, 24 Apr 2020 19:22:22 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id y81sw5eb2WO6; Fri, 24 Apr 2020 19:22:22 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id A6F2616008D; Fri, 24 Apr 2020 19:22:22 -0700 (PDT) Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkV5QWNtUUJFQURB QXlIMnhvVHU3cHBHNUQzYThGTVpFb243NGRDdmM0K3ExWEEySjJ0QnkycHdhVHFmCmhweHhk R0E5Smo1MFVKM1BENGJTVUVnTjh0TFowc2FuNDdsNVhUQUZMaTI0NTZjaVNsNW04c0thSGxH ZHQ5WG0KQUF0bVhxZVpWSVlYL1VGUzk2ZkR6ZjR4aEVtbS95N0xiWUVQUWRVZHh1NDd4QTVL aFRZcDVibHRGM1dZRHoxWQpnZDdneDA3QXV3cDdpdzdlTnZub0RUQWxLQWw4S1lEWnpiRE5D UUdFYnBZM2VmWkl2UGRlSStGV1FONFcra2doCnkrUDZhdTZQcklJaFlyYWV1YTdYRGRiMkxT MWVuM1NzbUUzUWpxZlJxSS9BMnVlOEpNd3N2WGUvV0szOEV6czYKeDc0aVRhcUkzQUZINmls QWhEcXBNbmQvbXNTRVNORnQ3NkRpTzFaS1FNcjlhbVZQa25qZlBtSklTcWRoZ0IxRApsRWR3 MzRzUk9mNlY4bVp3MHhmcVQ2UEtFNDZMY0ZlZnpzMGtiZzRHT1JmOHZqRzJTZjF0azVlVThN Qml5Ti9iClowM2JLTmpOWU1wT0REUVF3dVA4NGtZTGtYMndCeHhNQWhCeHdiRFZadWR6eERa SjFDMlZYdWpDT0pWeHEya2wKakJNOUVUWXVVR3FkNzVBVzJMWHJMdzYrTXVJc0hGQVlBZ1Jy NytLY3dEZ0JBZndoU In-Reply-To: <871rofxbz9.fsf@web.de> 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:178960 Archived-At: This is a multi-part message in MIME format. --------------6E97AB9219D2496F0B390A35 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 4/22/20 5:49 PM, Michael Heerdegen wrote: > + 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? No, because the list is not part of the expression that is being evaluated. However, something like this could cause trouble: (let ((l (list 'lambda '(x) '(setcdr l x)))) (eval (list l l))) because it modifies the list l while it is evaluating it. (As it happens, this code behaves differently in Emacs 26 than it does in Emacs 27 - that's what you can get with undefined behavior....) > 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. Both good points. The word "executed" is already gone from the manual, and I installed the attached patch to try to address the other point. --------------6E97AB9219D2496F0B390A35 Content-Type: text/x-patch; charset=UTF-8; name="0001-Tweak-mutability-doc-a-bit-more.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Tweak-mutability-doc-a-bit-more.patch" >From 49bc5a63f7d6178f136d9e28bcacda3acfc375d3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Apr 2020 19:19:31 -0700 Subject: [PATCH] Tweak mutability doc a bit more Inspired by a comment from Michael Heerdegen (Bug#40671#114). * doc/lispref/objects.texi (Constants and Mutability): Tweak further. --- doc/lispref/objects.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 1eda94ab63..b4e9ff4411 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -2401,8 +2401,8 @@ Constants and Mutability call @code{(make-string 3 ?a)} yields a mutable string that can be changed via later calls to @code{aset}. - A mutable object can become constant if it is passed to the -@code{eval} function, because a program should not modify an object + A mutable object can become constant if it is part of an expression +that is evaluated, because a program should not modify an object that is being evaluated. The reverse does not occur: constant objects should stay constant. -- 2.17.1 --------------6E97AB9219D2496F0B390A35--