From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: alists with precomputed variables Date: Tue, 20 Jan 2009 21:13:35 -0800 Message-ID: <004a01c97b87$03aa3ea0$0200a8c0@us.oracle.com> References: <4976ACB8.3030207@biostat.wisc.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232514839 1773 80.91.229.12 (21 Jan 2009 05:13:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2009 05:13:59 +0000 (UTC) To: "'Erik Iverson'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 21 06:15:12 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LPVQl-0004RL-EE for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Jan 2009 06:15:11 +0100 Original-Received: from localhost ([127.0.0.1]:45626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPVPU-0005jk-3Y for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Jan 2009 00:13:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPVPA-0005jQ-Qd for help-gnu-emacs@gnu.org; Wed, 21 Jan 2009 00:13:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPVP8-0005id-3v for help-gnu-emacs@gnu.org; Wed, 21 Jan 2009 00:13:32 -0500 Original-Received: from [199.232.76.173] (port=44925 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPVP7-0005iZ-OY for help-gnu-emacs@gnu.org; Wed, 21 Jan 2009 00:13:29 -0500 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:60551 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LPVP7-0000TR-F5 for help-gnu-emacs@gnu.org; Wed, 21 Jan 2009 00:13:29 -0500 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0L5FADe013020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 21 Jan 2009 05:15:11 GMT Original-Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0L5DHod008862; Wed, 21 Jan 2009 05:13:19 GMT Original-Received: from dradamslap1 (/24.5.128.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Jan 2009 05:13:15 +0000 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acl7hbQlSWuY03I7Qr+JBdtSe2qJnAAAEbnQ In-Reply-To: <4976ACB8.3030207@biostat.wisc.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt706.oracle.com [141.146.40.84] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4976AEED.00E9:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61518 Archived-At: > (setq my-var 20) > (setq my-alist '((p1 . 10) (p2 . my-var))) > > I naively thought that would give me > ((p1 . 10) (p2 . 20)) > > but it instead results in > ((p1 . 10) (p2 . my-var)) > > How can I get what I expected? (setq my-alist `((p1 . 10) (p2 ,@my-var))) or (setq my-alist (list '(p1 . 10) (cons 'p2 my-var))) or (setq my-alist (list (cons 'p1 10) (cons 'p2 my-var))) See the Elisp manual, node Backquote for info about ` and ,@. See also nodes Quoting and Building Lists.