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: Mon, 3 Dec 2018 00:41:01 +0900 Message-ID: References: <5C1642CD-F485-47CF-88B9-41D7960DDE80@gmail.com> 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 1543765172 2869 195.159.176.226 (2 Dec 2018 15:39:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2018 15:39:32 +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 16:39:27 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 1gTTqB-0000ex-PV for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 16:39:27 +0100 Original-Received: from localhost ([::1]:44952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTTsI-0003Vd-53 for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 10:41:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTTrs-0003Uc-5V for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 10:41:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTTrn-0004cQ-8N for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 10:41:12 -0500 Original-Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:33369) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTTrn-0004cC-2a for help-gnu-emacs@gnu.org; Sun, 02 Dec 2018 10:41:07 -0500 Original-Received: by mail-pl1-x62f.google.com with SMTP id z23so5174091plo.0 for ; Sun, 02 Dec 2018 07:41:07 -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=XW/kohT0ZiUTaKFdVFQbqy87SuSjm9iSHpxoLSzRj98=; b=G8hVUjfiopRWQ8Rhd6NuPmeiVVwcOy9PShvee4MAvYeo6gi7NBLd8Gt0ZCqQbhc2/z ba1ambAuELHpaBUKVutD1EZOu6X1RduN7DXTeYOTJE+ECDvuAVh+efzLaEhwT5TFf3Ui YzAb2i29AzID/CQw+EUf630TWiIMAMPgZr3NHmpeulSb6H4tqPSXi4B176tFAAaHLnl2 rx6uoQKBzJYPOnoDjbDaA3agHXE7iPk3Gg0L4uM5hDudZnB/j65nnYS9JlshmI9opnM2 rqOsm0pIsJEYP653AG5nTTqEH+RggYKSxDHj7QKOUb1z1SAOc0jQRhr+ZAWrAwHhZtMA oD5w== 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=XW/kohT0ZiUTaKFdVFQbqy87SuSjm9iSHpxoLSzRj98=; b=ZP7LdfT/MI9FHx4T5rAsQqKulZEratkmo5mw2Kx9SIX8SwdUHmM7lWCuOB6hnMgSjf /QPCv9zhlpSKxE65xOwQW8oL1ClpLpEW7HP91E4jhJyT3vLg6MihIMQl26N64gxpWkZ0 FS9AVfgRa1xHKV81lnYL7hdXzOwOTWfp1yTP/V1o25jfylLw1buNQ5XoDFwH+IV1ojff Pzjjyc0JOG0wqqdpoJEnqCSLlJxKmBLC3oObQ5xuqNGgZryZz5VgGQYaczeQN80FnkNv bX9/58/A6rfEL8rRf6gGcrAck4/dgFnMkdyRsqG8sAlF4vrMx0sowIc5E3OfVQQKfkzV 9JzQ== X-Gm-Message-State: AA+aEWZUi2qTipcEexHf8q5DKf3HxPGUmf10NGRuQTtnHTFJczjPbcjM /34+TEDScismKbbTKIbjl9DytHi/ X-Google-Smtp-Source: AFSGD/W4Nur8keSx5WAfG5VW2SZX+22UfI/B65hcJ2NEgX7+JkXm9iG5r4elsi45gRlutk+bLAhalQ== X-Received: by 2002:a17:902:9887:: with SMTP id s7mr12400168plp.199.1543765265507; Sun, 02 Dec 2018 07:41:05 -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 g136sm14101599pfb.154.2018.12.02.07.41.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Dec 2018 07:41:04 -0800 (PST) In-Reply-To: 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::62f 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:118831 Archived-At: > On Dec 3, 2018, at 0:07, Stefan Monnier = wrote: >=20 > Here's another take on it: >=20 >> If you do >> (setcar list0 0) >=20 > Why? Just don't use setcar/setcdr! Lovely :) When I check "Modifying Existing List Structure" the only things I find = of any use in my case are setcar/setcdr. >> There are probably better ways to create lists based on other lists = without >> "linking" the two, so I'd like some information about that. >=20 > The better way is to not modify the lists, so you're not affected by > whether they're linked or not. I would certainly have considered that if I had known that setq was = linking the lists :) And I'm sure the code I wrote is laughable, because there are probably = thousands of more idiomatic ways to write what I want to achieve, but if = there had been just a footnote about setq linking lists, I certainly = would not have spent the day on that :) Jean-Christophe Helary ----------------------------------------------- http://mac4translators.blogspot.com @brandelune