unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Erik Iverson <iverson@biostat.wisc.edu>
To: help-gnu-emacs@gnu.org
Subject: alists with precomputed variables
Date: Tue, 20 Jan 2009 23:03:52 -0600	[thread overview]
Message-ID: <4976ACB8.3030207@biostat.wisc.edu> (raw)

Dear all,

I'm an Elisp beginner, just learning over the last few days. Very naive 
question here, with hopefully a simple answer.

I would like to create an alist where one of the values is something 
that I compute earlier.  Example,

I naively thought that

(setq my-var 20)

(setq my-alist '((p1 . 10) (p2 . my-var)))

would give me

((p1 . 10) (p2 . 20))

, but it instead results in

((p1 . 10) (p2 . my-var))

How can I get what I expected?

If this is a wrong-headed question, please let me know.

Thanks,
Erik




             reply	other threads:[~2009-01-21  5:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21  5:03 Erik Iverson [this message]
2009-01-21  5:13 ` alists with precomputed variables Drew Adams
     [not found] ` <mailman.5420.1232514814.26697.help-gnu-emacs@gnu.org>
2009-01-21  5:49   ` Barry Margolin
2009-01-21  7:54     ` Drew Adams

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=4976ACB8.3030207@biostat.wisc.edu \
    --to=iverson@biostat.wisc.edu \
    --cc=help-gnu-emacs@gnu.org \
    /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).