From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.help Subject: Re: using setq to create lists based on other lists... Date: Sun, 2 Dec 2018 22:28:39 +0900 Message-ID: <6512D5B6-B3BE-4B02-81E0-B73F4BED9FCE@gmail.com> References: <874lbw4059.fsf@gmx.net> <87zhto2i0d.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1543757233 2123 195.159.176.226 (2 Dec 2018 13:27:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2018 13:27:13 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 14:27:09 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 1gTRm8-0000S7-Tk for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 14:27:09 +0100 Original-Received: from localhost ([::1]:44606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTRoF-0003E9-GC for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 08:29:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTRnj-000350-Hv for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 08:28:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTRng-0007hR-EI for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 08:28:47 -0500 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:34507) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTRng-0007hA-8H for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 08:28:44 -0500 Original-Received: by mail-pg1-x52c.google.com with SMTP id 17so4519906pgg.1 for ; Sun, 02 Dec 2018 05:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=S5+r2T3DBDaCfJgC4JNtzXOh8G7QFgjEyo+YrzkvJbg=; b=rP1+6XsHwmMRKD29RA4HK3frQOTZgPGkeV/j/ewAxAALYcvs2kd5EDx7YJ9qlvnpyi XKE2FN9QCeFKVZ0ephr8Yz0qyksayI4XbrspJcb1QaAAR1nBggyntONEvRoxwu7h61hu kLfhFtsieHUC5lky12G96a1cm4ueit4Y6iagSdOYnyLHjmxxPopfD5kT6SNcZJ6pMida g9MemFo3Nx2xTdsSS7gfdd98GbTJh3VysneKMZ7BpBXMEeVy9GJmaFyLTR+H96QSamPr WLPvO4oGYgF+hDhWqF9DBAVcYFQ5czXNKXmzisD6icjVYRTCA5chAAhG6k3tvSj5rICa 3few== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=S5+r2T3DBDaCfJgC4JNtzXOh8G7QFgjEyo+YrzkvJbg=; b=WdfPkzWmUm1x+y+uAkTPsHjfS6uZ+k7sd8i4c3hINPts6j38kmyyRrQSrxLrFoFyzN rK9JIhmlhNe+ur1NEWrWpXWp3nL/LDCNagWL38u/Whv70jj6ctuSxir2QmRU5/WQ43Xs gBD9seJ+LNcbxP698SMVLL4Y0U3ksGsvXsZlFya07wPGOljYK387qOHURoJw52B02mKa kuKfYkqaE1ouUBvuOzqQuRI+ZOVFXcL9ltoXlGEgzXJerXWjfdowbPgb7qMAUv0VcunN ReR+WlHU2A3/Ts1XlUtPD0Ji2zKq9MiYVczLQrbGfPUxIqluAT3rpGije6moFfuNuPq3 Pwsw== X-Gm-Message-State: AA+aEWbc7tcZXDM9vUIpthofOmBWd4BiRY6+X+eF1NUg+RI4sccIfrBM GIPu919/XNjEqcMN/w+ZZQ0bjVV8 X-Google-Smtp-Source: AFSGD/V7vyzOfpF65prbrgniYSITmhurnyrSmAbg6pJTmQdFKg/do0hxoEdicgGLXGhKRVLMxFZCIA== X-Received: by 2002:a62:434d:: with SMTP id q74-v6mr12417291pfa.242.1543757322765; Sun, 02 Dec 2018 05:28:42 -0800 (PST) Original-Received: from [192.168.1.11] (pl16832.ag0304.nttpc.ne.jp. [128.53.251.192]) by smtp.gmail.com with ESMTPSA id g3sm27764685pfe.37.2018.12.02.05.28.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Dec 2018 05:28:41 -0800 (PST) In-Reply-To: <87zhto2i0d.fsf@gmx.net> X-Mailer: Apple Mail (2.3445.101.1) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52c 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:118825 Archived-At: > On Dec 2, 2018, at 22:08, Stephen Berman = wrote: >>=20 >> That's not clear at all from the paragraph you quote. Because for all >> practical purposes, when I evaluate list0 I get (1 2) and not "a = pointer to an >> object that is the list (1 2)". >>=20 >> In fact, I just found the explanation, it is in the Introduction to = Emacs Lisp >> and it says: >>=20 >>> When a variable is set to a list with a function such as setq, it = stores the >>> address of the first box in the variable. >>=20 >> So, setq has a specific behavior when it applies to lists: it = evaluates the >> form as a pointer to an object and not as a value. >=20 > 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. 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. For ex. The first sentences of "Global Variables" in the Reference are = like this: > You specify a value for a symbol with setq. For example, (setq x '(a = b)) > gives the variable x the value (a b). They don't say: (setq x '(a b)) stores the address of the first (cons) cell in the = variable.=20 Which it does, and which is confusing if you expect x to hold '(a b), = like I was today. So I think it would be nice to add a few lines here and there to clarify = that behavior. Jean-Christophe Helary ----------------------------------------------- http://mac4translators.blogspot.com @brandelune