From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: emacs-27 eebfb72 1/2: Document constant vs mutable objects better, Re: emacs-27 eebfb72 1/2: Document constant vs mutable objects better, Re: emacs-27 eebfb72 1/2: Document constant vs mutable objects better Date: Sat, 02 May 2020 14:50:42 +0200 Message-ID: <871ro24i1p.fsf@gmail.com> 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> <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> <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> <87k12a4gm1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="4406"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Michael Heerdegen , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 02 14:50:34 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 1jUrbF-00012J-Je for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 14:50:33 +0200 Original-Received: from localhost ([::1]:51072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUrbE-0000iD-M4 for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 08:50:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUrai-0000Bc-Lv for emacs-devel@gnu.org; Sat, 02 May 2020 08:50:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUrai-0008EA-2k for emacs-devel@gnu.org; Sat, 02 May 2020 08:50:00 -0400 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:40122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUrah-0008Ah-Lq for emacs-devel@gnu.org; Sat, 02 May 2020 08:49:59 -0400 Original-Received: by mail-wm1-x32a.google.com with SMTP id u16so3202502wmc.5 for ; Sat, 02 May 2020 05:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=gvAMsvCBdHFyzCA8rV2kCQr3DKCaJxugdXVS0KhMYwU=; b=B8aFMIdx8iRMIWhh0AmPAZAHjiMcOSaTZjErAt2azS+w64ZVB5nM5LQupXCCSVOCuY ABACDszd50AXIIZSNQM+XdQ37xRr9k5eH0Bn0wHTj5XyewYb2is8qZyIzeYo9SemYZ3e W6GpYGBcofDEG8y2u+Q9TO4ltMEN/pNbrpCOwtzdKXIikeVLhsISK69JBYHUeTQeFE8K G5nfLyaAB0M2fm76yzGPvezN5DQPLeC72z1myYcQNcyltXUfwd2pdQKy7iKfIy6N1dLX /j9K7FsnX2ReXAaP2EdVe/BtZD8k/oEMzhYvjAKkheOJLYYeF+3PdlfRugRFhPyfyEha o41Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=gvAMsvCBdHFyzCA8rV2kCQr3DKCaJxugdXVS0KhMYwU=; b=hATPbIaVtupYahht1rSXbf51auIDB2KlLd8kTuAWJzYE1eykVQVPFcgIKnBjh573x2 GwYrbe3pSTGH4PY6ZZ1f8HtrrPC85RV1nXEOwG/G4Ao+DUGnzUABbl9/DseuYRJQRMCF bQcHzAHOYLn+xGsGCkLrC4migbyYMXNX7bpsu+fymrNnz8XAz3G/3sPUqLgivEHALeBM gwykVKFU+bSE45W6P/AkivkV0mxjRPMQEqfLp1Mt24eW4gzEBVw9np4n4tQRW5e559Tp UnFiHCGGfWRCDxkRk0/GlQ8RvSFAciSzNwm2+opLgDMNTSEjS31+8cC9UMu2aHeqpkSy 6lHA== X-Gm-Message-State: AGi0PuYV0m+dG6ViD7DHsUSA7cQMsfl4bXmIB6zCiiOJFL5d31SG5C1j o7STKuqdCFd7H6dYtGvF0IU= X-Google-Smtp-Source: APiQypI3KGEoOQ4Q6toks0QRn4SdKmirvyh3NYK0Os3x1Pmll6B33WhaVMAX5ZluQh0XVSHFfoLNPg== X-Received: by 2002:a1c:1b0b:: with SMTP id b11mr4758537wmb.182.1588423796234; Sat, 02 May 2020 05:49:56 -0700 (PDT) Original-Received: from localhost ([185.112.167.56]) by smtp.gmail.com with ESMTPSA id x18sm8989101wrv.12.2020.05.02.05.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2020 05:49:55 -0700 (PDT) In-Reply-To: (Paul Eggert's message of "Wed, 22 Apr 2020 10:54:12 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=stepnem@gmail.com; helo=mail-wm1-x32a.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::32a 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:248421 Archived-At: On Wed, 22 Apr 2020 10:54:12 -0700 Paul Eggert wrote: > On 4/20/20 3:05 AM, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec wrote: > >> how about, rather than giving examples that you would >> never use in real code, we change the examples as follows: >> (assq "simple leaves" leaves) >> =E2=87=92 unspecified ; might be nil or non-nil >> (assoc "simple leaves" leaves) >> =E2=87=92 ("simple leaves" . oak) > > Yes, that's fine. I installed the attached patch, which attempts to > address this, along with other comments by you and Drew. Thanks. >> Similarly for the others. > > What similar examples are there? As far as I can tell, the other > newly-introduced uses of copy-sequence are needed for mutability not > uniqueness, so they aren't similar. I meant the list examples you changed: you would never actually use (memq (list 2) '((1) (2))) instead of (memq '(2) '((1) (2))), same as you'd never use `copy-sequence' to make sure you have a fresh comparison key. Rather, the point of that section is to use `member' instead of `memq', analogously to `assoc' vs `assq' above. >> the examples you give IMO don't illustrate that some strings or lists >> are mutable and some are not; it illustrates that mutating some lists >> or strings has undefined consequences. > > I have a different impression, I think the string that (symbol-name > 'lambda) returns really is constant. Currently Emacs doesn't behave > well if you try to change that string (and Emacs should behave > better): but it's a feature not a bug that you can't mess up the Lisp > interpreter in such a fundamental way, and if we make improvements in > this area they should not change the fact that these string values > should stay constant. I still think we are miscommunicating due to the different usage or notion of "mutable". All I'm saying is that if you introduce wording such as "the other arguments (all but the last) should be mutable lists", that (to me, and I'm sure many other readers) implies that you are talking about (types of) data structures, i.e. that there is such a thing as mutable (and also immutable, because why would you use that term otherwise?) lists/conses/strings as opposed to something else, as there indeed is in some languages, including Scheme (e.g. SRFI 140) or Racket. I'm not saying that the difference between the values of (symbol-name 'lambda), "lambda" and (copy-sequence "lambda") or (list 1) vs '(1) aren't real, important or worth clarifying, only that unqualified "mutable" is an unfortunate term to use (and AFAICT you introduce this usage to the documentation; it was pretty much nonexistent before your recent changes). --=20 =C5=A0t=C4=9Bp=C3=A1n