unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jay Belanger <jay.p.belanger@gmail.com>
To: emacs-devel@gnu.org
Cc: jay.p.belanger@gmail.com
Subject: Odd behavior of `eval-when-compile'
Date: Sun, 08 Jul 2007 00:25:01 -0500	[thread overview]
Message-ID: <87odinxyaa.fsf@gmail.com> (raw)


I came across the following surprising (to me) behavior for
`eval-when-compile'.  Suppose I have two files:
a.el, containing
   (defvar vara 2)
   (provide 'a)
and b.el, containing
   (require 'a)
   (defvar varb (eval-when-compile (+ 1 vara)))
If I byte compile b.el, it works fine.
However, if I have a file b.el containing
   (defvar vara 2)
   (defvar varb (eval-when-compile (+ 1 vara)))
and then byte compile it (in a new Emacs session), I get an error
    Symbol's value as variable is void: vara
Is there a reason for this behavior (I didn't find it in the elisp
manual), or is this a bug?

Jay

             reply	other threads:[~2007-07-08  5:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  5:25 Jay Belanger [this message]
2007-07-08 18:51 ` Odd behavior of `eval-when-compile' Stefan Monnier
2007-07-08 18:54   ` Jay Belanger

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=87odinxyaa.fsf@gmail.com \
    --to=jay.p.belanger@gmail.com \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).