From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Appending lists Date: Wed, 16 Jun 2021 20:54:51 +0200 Message-ID: <20210616185451.GB18839@tuxteam.de> 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> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="61jdw2sOBCFtR2d/" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15340"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) To: Philip Kaludercic , Yuri Khan , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 16 20:56:21 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 1ltai5-0003r0-0K for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Jun 2021 20:56:21 +0200 Original-Received: from localhost ([::1]:58334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltai4-0007e3-0B for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Jun 2021 14:56:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltagl-0007bA-4j for help-gnu-emacs@gnu.org; Wed, 16 Jun 2021 14:55:05 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:33913) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1ltagh-0003ja-AD for help-gnu-emacs@gnu.org; Wed, 16 Jun 2021 14:54:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=D3+xfOaTSQfRfaDTZeaVc9W/UGljBYDZyADp2Y8wDBI=; b=IV7nQdF+Ubwsb2g9y2T4aeHIJLXANXfODz0c9JtfqVaZJM9KAxpgAnoST+fb9H/GbN4dIrIdeS/vkabzXyv9uI+ID8Qm6GbjTqbBIdSsm+Lu854ytRIe9Xz1J9baZfCGUc4UVWawWC97T+7garLjGbGZpsigp7nJQpZqa8l0VuZFfzOV/hbvKhfbWdCS7Wwq3zaxeavy1ZyP9uxYq4L5Pkx7J50hRUQhqSEBOu6GTfvFC00/TAg13MQLwJEE9q7XSIEBFfpOaq5c+wMLSbzPTkv5s8LypJlOlBrNPqw0Zopp48AFlxc0bGX+xwXG1xaA+4rVB50VWoepg9Lv31tqJg==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1ltagd-00052C-Dy; Wed, 16 Jun 2021 20:54:51 +0200 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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:130925 Archived-At: --61jdw2sOBCFtR2d/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 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 --61jdw2sOBCFtR2d/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmDKSPsACgkQBcgs9XrR2kb3DACfbV8aRFVQizdJwuNfHcWb7xaZ iYIAn3c+x4KEoQzQ2u4BaQGg17n3/Uye =hR4G -----END PGP SIGNATURE----- --61jdw2sOBCFtR2d/--