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: Wed, 29 Apr 2020 03:14:22 +0300 Message-ID: References: <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> <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> 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="33541"; 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 Wed Apr 29 02:17: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 1jTaQH-0008bl-Vi for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Apr 2020 02:17:58 +0200 Original-Received: from localhost ([::1]:55362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTaQH-0006xQ-11 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 20:17:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38300) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTaPW-0006Ty-NU for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:17:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTaNU-0001T4-56 for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:17:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTaNR-0001SA-PS for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTaNR-00013j-Kn for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:15: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: Wed, 29 Apr 2020 00:15: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.15881192724017 (code B ref 40671); Wed, 29 Apr 2020 00:15:01 +0000 Original-Received: (at 40671) by debbugs.gnu.org; 29 Apr 2020 00:14:32 +0000 Original-Received: from localhost ([127.0.0.1]:41951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTaMy-00012j-3g for submit@debbugs.gnu.org; Tue, 28 Apr 2020 20:14:32 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:43368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTaMv-00012V-TV for 40671@debbugs.gnu.org; Tue, 28 Apr 2020 20:14:30 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id i10so389103wrv.10 for <40671@debbugs.gnu.org>; Tue, 28 Apr 2020 17:14:29 -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=Y2WMZf1C4lyr8bueEo911O9ejEUlObqcAd6RxxxdauQ=; b=nIZOed4lV5JfJsV1wweDzqEOJ35pYVpCi4pwnWRYLczZTSXZvVApoiASPzvz64ksNK p1FjckEbdLVbdu6mUqDswxXMfl532zj2k+Khai1BE3mG1NpDIxOvffUjCEO9mMDI/FjL bQZxS17+KVFOutBBkMnziX6PNjQ7FljUvdB4iopga05rhnIUwpiQmkdiEkkMB0PnDCSp 64agdFEsGSrvE438VSa+BXX3jt0cZ3UQZd8S8Q+HpCJIvePmaS7fL/W9b1XY6Nr+FmRs yyDnLh8tBS0dFr+anQio1iewDdDgq4eB0gqlfXGFPBRuhAgb97WZmJB3INaIQkpvZhiO AGzw== 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=Y2WMZf1C4lyr8bueEo911O9ejEUlObqcAd6RxxxdauQ=; b=nPYFCVoaWtulxrXc/FzuWXljgoD2r2AKZ2QWiwS5eMAQOeNpKlXv5BmJIAhMeL7Uxr Q2zHWMjAsbqDFR5MV43AFMGfmmKu2a9NOXKd2fjlATXyLLBSRiZgxuyZa261LA3zsFG+ QjgQ+MeZrJFqQbBlYfHRjEjJQmn8UiCS0ePUho2Il5rNy6MQlEJMPJS3hxXCBRNS4W18 J1qmAkuqaYsMgnZV7ulXa4TU7vo55fVvioesnNqAeTJmijjOw6bADmYQ6aa4i1LX4AAM HUp22xZOGyGqdIFNiPKL6HCkj2t4f6PUg/SWhs0+GSpxSugKAfKIrc+xQaGWSbE8LYpz t/Pg== X-Gm-Message-State: AGi0PuZpxju/aEGELzM9sk3x7M2yKpCge36cv8SzX3tzOPZGMIJ2B9Cc 6NXbd7faeMacSE5Ku3qvUJE= X-Google-Smtp-Source: APiQypLPF3m8icfsCU62rAOFcYkFpZBB4Ugk83cNR93eceOzwlbdrHQFfBuErnycTtHOw+s1T99B9g== X-Received: by 2002:adf:9564:: with SMTP id 91mr37052935wrs.246.1588119264266; Tue, 28 Apr 2020 17:14:24 -0700 (PDT) Original-Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id d143sm5213215wmd.16.2020.04.28.17.14.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Apr 2020 17:14:23 -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-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:179263 Archived-At: On 29.04.2020 03:04, Paul Eggert wrote: > It's reasonable to have compile-time checking in a statically-typed language, > though (as the above quote notes) the checking isn't adequate for C++ and one > can get undefined behavior anyway in that language. All the undefined-behavior stuff in the language is part of backward compatibility with C. Like I said, the same argument that says "you can change a const in C++" also says "string and int and void are basically the same type". > And we could add some > similar compile-time checking for the Elisp byte-compiler: it could warn about > misuses like (aset "abc" 0 ?d), for example. Not the worst idea. Won't work: it's a dynamic language. Hence the example of how a similar problem was dealt with in a fellow dynamic language that I wrote about a couple of messages ago. > However, any such compile-time checking would be either too restrictive (with > false positives) The "too restrictive" end of the spectrum will result in prohibiting the user from modifying any and all conses. > or only partial (with false negatives) or both (as in C++). So > it wouldn't be an adequate substitute for documenting that some objects should > not be changed. With runtime checks, it could. But that might be too costly. > I recall your using "literal object" but that's not a good choice of wording > because the problem can occur with objects that are not literally present in any > source code. "Any object that is part of a literal value". You can probably extend that sentence to be exhaustive. > By "elsewhere" I meant in other language documentation (C/C++/etc.), not > elsewhere in the emacs-27 manual. In "etc", you mentioned Common Lisp previously. Any idea how it deals with that problem?