From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.help Subject: Re: Appending lists Date: Wed, 16 Jun 2021 21:24:19 +0000 Message-ID: <87czslv6yk.fsf@posteo.net> References: <87zgvs2bup.fsf@zoho.eu> <87y2bby1kr.fsf@zoho.eu> <20210615091834.GB24886@tuxteam.de> <87im2ewr3k.fsf@zoho.eu> <20210616072819.GB17919@tuxteam.de> <87im2eufop.fsf@posteo.net> <20210616185451.GB18839@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23152"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs , Yuri Khan To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 16 23:25:37 2021 Return-path: Envelope-to: geh-help-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 1ltd2W-0005nn-Ig for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Jun 2021 23:25:36 +0200 Original-Received: from localhost ([::1]:56818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltd2V-0001sb-H7 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Jun 2021 17:25:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltd1Z-0001sT-D3 for help-gnu-emacs@gnu.org; Wed, 16 Jun 2021 17:24:37 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:46195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltd1N-0001vf-MZ for help-gnu-emacs@gnu.org; Wed, 16 Jun 2021 17:24:37 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 2AE9824002A for ; Wed, 16 Jun 2021 23:24:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1623878661; bh=ecy15dnI125uWtGesiGq6wd8vjCPAa0pmGasIF8LlnE=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=cs4KFS3V9k9XVrebnOE5b9MthE0OebUrelXzFWEjbDMZwg/2OEV92Q65jQf+5VT7o yfk3b4p/gJMLmYEZlc/sLJPwmzrhu4G+3C8PiC1GrIOpfSIxSojiAxXURfRG7Ke8Cc KxdcoHJDKm+QMHQIxkK0n6M/89UskmlVXlcUSedch7jaqizXdMXGd9qt2csvGEXVCJ Dzg662gGueEI35qkuwA3NvMR0QdfvVvv/6wyKY9fC81Xcn300uRQTBIPHsWV3TxC3f YmrC6ff2RLdfPIHGFFIp0LNI7CAnfH23XJea+PYvBAVVrW5Mdk+T8lPypV/KvhWVV6 79njaQUTQtezQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4G4yqm3gbrz9rxG; Wed, 16 Jun 2021 23:24:20 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=mutual; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <20210616185451.GB18839@tuxteam.de> (tomas@tuxteam.de's message of "Wed, 16 Jun 2021 20:54:51 +0200") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130926 Archived-At: writes: > On Wed, Jun 16, 2021 at 08:36:00PM +0300, Jean Louis wrote: >> * Philip Kaludercic [2021-06-16 16:07]: >> > > (setq list '(A B C)) =E2=87=92 (A B C) >> > > (nconc list '(1 2 3)) =E2=87=92 (A B C 1 2 3) >> > > list =E2=87=92 (A B C 1 2 3) >> >=20 >> > Change that to >> >=20 >> (let* ((list-1 '(a b c)) >> (list-2 (nconc list-1 '(1 2 3)))) > ^^^^ not recommended: '(a b c) is a "constant object" > Some version of elisp might even refuse to do tha= t! True, I wanted to do (list 'a 'b 'c) but I didn't want to change the example that much. Also, what versions of elisp wouldn't allow that? >> (eq list-1 list-2)) ;; =3D> t >>=20 >> eq - Return t if the two args are the same Lisp object. >>=20 >> And we talked how variable's value does not change... values or Lisp >> objects? >>=20 >> (setq list-1 '(a b c)) >> list-1 =E2=87=92 (a b c) >> (setq list-2 (nconc list-1 '(1 2 3))) =E2=87=92 (a b c 1 2 3) >> list-2 =E2=87=92 (a b c 1 2 3) >> (eq list-1 list-2) =E2=87=92 t >> list-1 =E2=87=92 (a b c 1 2 3) >>=20 >> How I see that is that it is same lisp object, but I can visually see >> that the value changed.=20 >>=20 >> Maybe Thomas wanted to say that lisp object does not change?=20 > > On the contrary. Mutable objects can change. Cons cells are > mutable objects, and thus lists, which are made of those. > > Cheers > - t > --=20 Philip K.