From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: using setq to create lists based on other lists... Date: Sun, 02 Dec 2018 15:40:01 +0100 Message-ID: <87a7lo3sce.fsf@web.de> References: <874lbw4059.fsf@gmx.net> <87zhto2i0d.fsf@gmx.net> <6512D5B6-B3BE-4B02-81E0-B73F4BED9FCE@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543762258 6472 195.159.176.226 (2 Dec 2018 14:50:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2018 14:50:58 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs To: Jean-Christophe Helary Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 15:50:54 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTT5A-0001WG-Dg for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 15:50:52 +0100 Original-Received: from localhost ([::1]:44812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTT7H-0005HH-4m for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 09:53:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTT5C-0003wr-89 for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 09:50:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTSul-000747-7D for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 09:40:10 -0500 Original-Received: from mout.web.de ([217.72.192.78]:50239) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTSuk-00073W-V3 for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 09:40:07 -0500 Original-Received: from drachen.dragon ([94.218.210.177]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MbQKW-1gm5h20HfI-00Inli; Sun, 02 Dec 2018 15:40:04 +0100 In-Reply-To: <6512D5B6-B3BE-4B02-81E0-B73F4BED9FCE@gmail.com> (Jean-Christophe Helary's message of "Sun, 2 Dec 2018 22:28:39 +0900") X-Provags-ID: V03:K1:fQxsXFTMV14XWxWfYJEH3I329EtfuNMLDNBQ/axh8E4vq1hV4KO GC99fgrJnBH9iNzo9h1r+OyM4LYnSKCSAReReQ3ZAgSWSp2vD4h3OStUc/XcxDZtMp2Hw39 X3WnFpcESU4njDcsipbu9z+prU35BrW3IF1JKX2FEvclm6LPzJPb5xInR3F2qTEP/wNPFeA yk59/PfSBka79m+7ydCpw== X-UI-Out-Filterresults: notjunk:1;V03:K0:AAgSVeJOe5s=:0nH+iPYU1kdw+Iy5N+Ph7A myHHEYuPJGGl/pYrcK78uMOVCeWYg0ezURjqLHvcmmWbJcpQ6S28nb6M5INZ2+9alI1sBcBWv IuTsenYC7Bo4DwDRAKGpizth1j+dXLE9gzjU51NpTX5vzuzllU6l68O0mzv8rBQtJg4kt+uTb VDm5C0MN6crhc+poRPkLwXPelPJdxmqA8o3arW/GYoAN++0DY5c3ORECR1PlybBKPaLOkFH/g 8uIbrvr2Cq10jh9TNSgVZtYcf3hrjxZVkZznqSxjVoJRq+UitAyH0yWVYU6soV4kQ76esBjh8 spkSQB4A4lC5IFU4UwTk5D5QwrTqBb8uAoDK037du9OlUeWC5e+DRDwO6/ueUoPxq5JZ4Nf8V q9VQiaOSzsZ7N9HV9L2x2P/VHFeNvlCSm/kFO9uy3zL0RDznXwe4YmyWUkycvnDDxQG1wu5GU yMm/72/hVXfKVA4TeY40HvzH/a1NgVdbzO1QJHv3EcuMz0WizvTktxw4xmjqeNFbzZNhyWTRI k05pFgwU920axrIrTFcyBPRuR1HaOMPKTOdvG9TW9qlBjqwJj7PpmnhoknQbbjbMdZ3WzCAIj uerTf92Yavgh5fzq5x4s8Z03WvYXBs7zEIcndHJAYHjlzoitfIurW7LiSL/yRVSVIMgVhq942 422vKYUG1TU+GfW4SOhyPByvLnislkR09fO3QDsj2ncOuQ58UfB29TfikgyPd4hm+gUICrrc3 Uuz7iTYZZmJBuZxCS98qHaV82hcpdlpnvXukTJy9faS4nqW5btxiHEJJYaTYqX+8IN2HLeMf X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.78 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118826 Archived-At: Jean-Christophe Helary writes: > > I don't think setq is behaving any different with lists than with other > > Lisp objects. Lists are defined this way in Lisp, cf. (info "(elisp) > > Cons Cell Type"): > > Yes, but a list does not generally evaluate to a pointer to the first > cell of its cons. When one is saying that lists are referenced by pointers this is mainly to help people coming from other programming languages to understand that multiple variables can be bound to the same object. It's probably better to say that multiple variables can be bound to the same value (or object). Apart from that, note that a list is identical to its first cons. > Which is the case when setq is used. Which is the reason why the > Introduction insists on that aspect of setq, because before that, all > the setq examples assigned "straight" values to variables. There is nothing special with setq here, really. Whenever you refer to the same Lisp object in different places in your code in whatever way, you see the same object modified in all places at the same time when you modify it. Variables bound to the same value (via setq or in any other way) is only one case. In Lisp it's always like that, as long as you look at the same value. It is also not special to lists: you get the same for all objects that can be modified, like any conses and trees, strings, arrays, keymaps (which are actually lists), defstructs, eieio objects, vectors, bool-vectors, ... Michael.