emacs-devel
[Top][All Lists]
Advanced

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

Odd behavior of `eval-when-compile'


From: Jay Belanger
Subject: Odd behavior of `eval-when-compile'
Date: Sun, 08 Jul 2007 00:25:01 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

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 via email to

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