unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
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

  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

  List information: https://www.gnu.org/software/emacs/

* 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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).