help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: associative list won't append variable contents


From: Dr. Shred
Subject: Re: associative list won't append variable contents
Date: Tue, 14 Feb 2006 05:19:52 GMT
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

It worked.  Thanks!  I couldn't find this info in the emacs
manual.  Is there some good documentation available for
emacs lisp?


David Hansen wrote:
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 via email to

[Prev in Thread] Current Thread [Next in Thread]