all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Odd behavior of `eval-when-compile'
@ 2007-07-08  5:25 Jay Belanger
  2007-07-08 18:51 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Jay Belanger @ 2007-07-08  5:25 UTC (permalink / raw)
  To: emacs-devel; +Cc: jay.p.belanger


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-08 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-08  5:25 Odd behavior of `eval-when-compile' Jay Belanger
2007-07-08 18:51 ` Stefan Monnier
2007-07-08 18:54   ` Jay Belanger

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.