From: David Hansen <david.hansen@gmx.net>
Subject: Re: associative list won't append variable contents
Date: Tue, 31 Jan 2006 11:31:52 +0100 [thread overview]
Message-ID: <873bj4wuw7.fsf@robotron.kosmorama> (raw)
In-Reply-To: BqCDf.28807$H71.25237@newssvr13.news.prodigy.com
On Tue, 31 Jan 2006 05:18:25 GMT Shred wrote:
> (setq car-0 foo-0)
> (setq cdr-0 foo-1)
> (setq file-list (append '((car-0 . cdr-0)) file-list))
>
> I want the contents of car-0 and cdr-0 to be the actual
> car and cdr.
>
> Lisp creates
>
> ((car-0 . cdr-0))
>
> not
>
> ((foo-0 . foo-1))
>
> Shouldn't this work?
The `quote' inhibits all evaluation. Either use the
`list'and `cons' function
(append (list (cons car-0 cdr-0)) file-list)
or the IMHO easier to read `backquote' (C-h f backquote RET
for more information):
(append `((,car-0 . ,cdr-0)) file-list)
David
next prev parent reply other threads:[~2006-01-31 10:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-31 5:18 associative list won't append variable contents Dr. Shred
2006-01-31 10:31 ` David Hansen [this message]
2006-02-14 5:19 ` Dr. Shred
2006-02-14 9:42 ` Peter Dyballa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873bj4wuw7.fsf@robotron.kosmorama \
--to=david.hansen@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.