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.devel Subject: Re: emacs-27 eebfb72 1/2: Document constant vs mutable objects better Date: Sun, 19 Apr 2020 16:48:46 -0700 Organization: UCLA Computer Science Department Message-ID: References: <20200418200112.26900.1274@vcs0.savannah.gnu.org> <20200418200114.85C8C20A2B@vcs0.savannah.gnu.org> <87wo6c5vxf.fsf@gmail.com> <54e69de3-f1b9-cbcc-dec1-11f5b1bcd481@cs.ucla.edu> <87o8rn3y2k.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="75235"; 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: emacs-devel@gnu.org To: =?UTF-8?B?xaB0xJtww6FuIE7Em21lYw==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 20 01:49:47 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jQJh3-000JS2-RE for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Apr 2020 01:49:45 +0200 Original-Received: from localhost ([::1]:55306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJh2-0003IZ-Tw for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Apr 2020 19:49:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44746 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJgD-0002or-1g for emacs-devel@gnu.org; Sun, 19 Apr 2020 19:48:53 -0400 Original-Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQJgC-0007f9-Es for emacs-devel@gnu.org; Sun, 19 Apr 2020 19:48:52 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44230) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jQJgB-0007Ws-Ih for emacs-devel@gnu.org; Sun, 19 Apr 2020 19:48:52 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7F111160054; Sun, 19 Apr 2020 16:48:48 -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 vgpXmkE93nSq; Sun, 19 Apr 2020 16:48:47 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 74289160065; Sun, 19 Apr 2020 16:48:47 -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 YPV9UbXFjVJE; Sun, 19 Apr 2020 16:48:47 -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 395C2160054; Sun, 19 Apr 2020 16:48:47 -0700 (PDT) In-Reply-To: <87o8rn3y2k.fsf@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-detected-operating-system: by eggs1p.gnu.org: Linux 3.1-3.10 X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:247342 Archived-At: On 4/19/20 3:33 PM, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec wrote: > Regarding comparing two equal floats, strings or lists by `eq', you war= n > about its undefinedness ("might not return nil") repeatedly, but can yo= u > give an actual example where (eq 1.2 1.2) or (eq "string" "string") > returns non-nil in Elisp? (let ((str "abc")) (eq str "abc")) This yields t when byte-compiled. > I still think that formulations like > "the other arguments (all but the last) should be mutable lists" are > unfortunate, because all Elisp lists are mutable. Pure lists are not mutable. (Admittedly these are getting rare...) > All lists/strings/vectors are > mutable in Elisp. No, there are exceptions. For example the following makes my Emacs dump c= ore,=20 even though all it does is modify a string. (aset (symbol-name 'cons) 0 ?x) It's trying to change the spelling of the name of the 'cons' function, bu= t that=20 spelling is in memory that the operating system protects on my platform. > I don't think calling the > same data structure once "mutable" and once not will help rather than > confuse or mystify. Yes, we should definitely be consistent in whatever terminology we use. A= nd it's=20 quite plausible that the terminology in the current (emacs-27) manual can= be=20 improved. However, I don't know what terminology people would prefer. ("L= iteral=20 object" is one possibility, but it has its own problems.) >> + A self-evaluating form yields a constant, and you should not attemp= t >> +to modify the constant's contents via @code{setcar}, @code{aset} or >> +similar primitives. The Lisp interpreter might unify the constants > ^^^^^^^^^^ > In the Elisp manual, "primitive" is defined as "A function which is > callable from Lisp but is actually written in C", but I think we want t= o > say that one shouldn't try to modify constants, period; no matter the > particular means used. Thanks, I changed "primitives" to "operations".