From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#43557: 28.0.50; Please document which objects are mutable and which are not Date: Thu, 03 Jun 2021 10:41:56 -0400 Message-ID: References: <87mu0nv6y6.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29280"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 43557@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 03 16:43:23 2021 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 1looZ9-0007Nw-3N for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Jun 2021 16:43:23 +0200 Original-Received: from localhost ([::1]:34094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1looZ8-0006ko-5O for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Jun 2021 10:43:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1looYo-0006jK-Ns for bug-gnu-emacs@gnu.org; Thu, 03 Jun 2021 10:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1looYo-0001qr-F9 for bug-gnu-emacs@gnu.org; Thu, 03 Jun 2021 10:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1looYo-0006Ej-Cy for bug-gnu-emacs@gnu.org; Thu, 03 Jun 2021 10:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Jun 2021 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43557 X-GNU-PR-Package: emacs Original-Received: via spool by 43557-submit@debbugs.gnu.org id=B43557.162273133423909 (code B ref 43557); Thu, 03 Jun 2021 14:43:02 +0000 Original-Received: (at 43557) by debbugs.gnu.org; 3 Jun 2021 14:42:14 +0000 Original-Received: from localhost ([127.0.0.1]:44463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1looXy-0006DW-4P for submit@debbugs.gnu.org; Thu, 03 Jun 2021 10:42:13 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1looXs-0006Cy-PC for 43557@debbugs.gnu.org; Thu, 03 Jun 2021 10:42:08 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 08D2C1002C7; Thu, 3 Jun 2021 10:41:59 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 417281001F4; Thu, 3 Jun 2021 10:41:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622731317; bh=5uEPpLI5CMtRrsgz8NcjYjFsC96TFrzEWCz7t4N4ChQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VyVfiJiS2Jz0nn7Lekl8pS0usL2yzQEEJSZ2UJjSMf3hKsNI0SmzZaR0Frnu5TJc/ Ce4D9FutRm4uUkN/xXCAvtGG4VVYSWLUnt4OaF30UJ20k84oSVPWlBfQwhSFOkuej0 GaTtJCG4ydGyyE/8FxpbyOk/abXbo++AFy/5ub+EbsATAofvmq6Wi5n3IakZic5Z9B KRifxHT5wMo9+hbOQhNdrEylc9Sl6mewkS2uG6uXDN+buWOLVI9OT8mDReUtXoC/gF XVmqU66c/Q5TcAqRs+Kvwuqztd/VUfe6zRESo1pbbqEDJJf49nOkxqmUr+of7SeerK hvWXZ0yNM2KSQ== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 16DEC1202EE; Thu, 3 Jun 2021 10:41:57 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Sat, 31 Oct 2020 16:54:37 +0100") 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:207956 Archived-At: > I disagree. "Pretty clear" would mean "allowing the reader to classify > each Lisp expression w.r.t. the mutability of its value", and as the > section only gives a few examples, it can't do that. What it should do > in addition is provide rules on how to classify any given Lisp > expression. Each possible Lisp expression has to fall into exactly one > of three categories: > - The value is mutable. > - The value is immutable. > - It is unspecified whether the value is mutable or immutable. While I can kinda see where you're going, it's still pretty fuzzy to me. I think it would be more clear if you could give concrete cases where you'd want to use such information. > Then the docstring of `list' and the ELisp manual should say that. The > difference between shallow and deep immutability might not be clear to > all readers, so it's important that it's documented as well. This is a pervasive issue, much more pervasive than `list` and that applies to pretty much all programming languages. So I don't think it has its place in the doc of `list`. I hope the box diagrams of the intro to ELisp can be considered a documentation of this phenomenon. > it must be possible for programmers to derive whether (setcar var ...) > is allowed from some set of rules plus the docstring of the function. [ Aha: here's is an example! ] Mutability says whether it is *possible*, rather than whether it's *allowed*. Most (all?) cons cells are mutable, but it is strongly recommended to refrain from mutating most cons cells (because it can/will have unexpected consequences because that same cons cell is also used elsewhere). So what you're asking here is not exactly mutability but something slightly different, which is not very well defined nor documented, indeed. Stefan