From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: using setq to create lists based on other lists... Date: Tue, 04 Dec 2018 04:00:32 -0500 Organization: A noiseless patient Spider Message-ID: References: <874lbw4059.fsf@gmx.net> <87zhto2i0d.fsf@gmx.net> <6512D5B6-B3BE-4B02-81E0-B73F4BED9FCE@gmail.com> <87r2f02cue.fsf@rub.de> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1543914216 1459 195.159.176.226 (4 Dec 2018 09:03:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2018 09:03:36 +0000 (UTC) User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 04 10:03:32 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 1gU6c8-0000Gr-Ks for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Dec 2018 10:03:32 +0100 Original-Received: from localhost ([::1]:54665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU6eF-0000Ak-3y for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Dec 2018 04:05:43 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-Injection-Info: barmar.motzarella.org; posting-host="f7ee4e2e01e774dd371d52ce6edcb0c7"; logging-data="28831"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19v2F9hiv8GtJ9gkla0ivqm" Cancel-Lock: sha1:z/YN5Y8zOAi3GaLlJ+iELQlCUAI= Original-Xref: usenet.stanford.edu gnu.emacs.help:224717 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:118847 Archived-At: In article , Jean-Christophe Helary wrote: > > On Dec 3, 2018, at 0:00, Stephen Berman wrote: > > > > I think your confusion may be due to not distinguishing the value > > assigned by setq, which is a particular object, and the form of the > > value, which may look the same but nevertheless be a different object. > > You are absolutely right. > > But I think the "not distinguishing" the difference between the two is > partially caused by the way the Reference is written: > > Global Variables: > > You specify a value for a symbol with setq. For example, (setq x '(a b)) > > gives the variable x the value (a b). > > This is not saying: gives the variable x a pointer to the object (a b) There are no pointers in Lisp. There are just objects, the pointers are in the implementation. The important thing is that (setq list1 list2) doesn't make a copy of the value of list2 when assigning to list1. The two variables refer to the same value when this is done. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***