From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.help Subject: Re: Appending lists Date: Thu, 17 Jun 2021 09:14:48 +0200 Message-ID: <20210617071448.GA16310@tuxteam.de> References: <20210615091834.GB24886@tuxteam.de> <87im2ewr3k.fsf@zoho.eu> <20210616072819.GB17919@tuxteam.de> <87im2eufop.fsf@posteo.net> <20210616185451.GB18839@tuxteam.de> <87czslv6yk.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21415"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: help-gnu-emacs , Yuri Khan To: Philip Kaludercic Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 17 09:15:57 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 1ltmFo-0005IL-Uw for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 09:15:56 +0200 Original-Received: from localhost ([::1]:52138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltmFn-0001Zc-VT for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 03:15:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltmEs-0001ZR-94 for help-gnu-emacs@gnu.org; Thu, 17 Jun 2021 03:14:58 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:35460) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1ltmEk-0002jX-On for help-gnu-emacs@gnu.org; Thu, 17 Jun 2021 03:14:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=crf58wqCu5oWlz+s8NaXDGByv+9X4UB9Yru1jVfVm0k=; b=Z9V7OFogS4CxKP/F5nVypYe1Mt+73TPFRVC324uU6RMEqZP5vK9g1ylqtH+D5jlrpjnpU0ugE84g7DRCVyh5oGE7ruYZkeYG1xTuZ5Oyd62YxiME2/Aq39bFg3fi3IOSCzcT3uY7i6JuS14ITYoZbCo1LQK7Z82tNSMuA9xVOY/lYkbM7Pwjz6hk6A0EzVlLYL/5zngX+v0n95DxBixc5wKcNKxQesxNFyjp1Nb+i1N2Z7SW95VIam9iZV+XpDXRCXxiktjI0ugvIWe3hjS60EcDeLZIKFt9LEqNXpALpfi8MKIBwOpXFNZGj2t8S5S1G8s72ltd3XY4n5hayjk41A==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1ltmEi-0004Q5-4i; Thu, 17 Jun 2021 09:14:48 +0200 Content-Disposition: inline In-Reply-To: <87czslv6yk.fsf@posteo.net> 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:130954 Archived-At: --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 16, 2021 at 09:24:19PM +0000, Philip Kaludercic wrote: > writes: >=20 > > 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 t= hat! >=20 > True, I wanted to do (list 'a 'b 'c) but I didn't want to change the > example that much. That's OK. It works, after all ;-) I do that all the time, for playing around. But don't do that in production, that's all. When publishing as an example, at least, a comment is in order. In your case, instead of (list 'a 'b 'c), an alternative would be (copy-sequence '(a b c)). My comment was there because our current topic is "identity and mutability", thus it seemed relevant to me. It wasn't to critizice your code, i /know/ it was just a quick example. > Also, what versions of elisp wouldn't allow that? Wait and see :) I don't think it's planned for now, but I wouldn't exclude it either, but oh, wait. Have a look at section "E.2 Pure Storage" of the Emacs Lisp manual. Perhaps there are immutable objects around, after all :-) Cheers - t --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmDK9mgACgkQBcgs9XrR2kaaLQCeLmT6d1GB7+a6RTgEbUrw5fnh owcAn1z6V3n0jfd5VpkaT3T23ByMMDws =kg01 -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s--