[Top][All Lists]

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

Re: use of (defvar <foo>)

From: Stefan Monnier
Subject: Re: use of (defvar <foo>)
Date: Sun, 09 Apr 2006 20:29:53 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> From the future's point of view (Emacs-22 and up), placing such defvars
>> inside eval-when-compile is a bad practice (in the future it may even fail
>> to work since there's nothing that guarantees that the content of
>> eval-when-compile is actually compiled rather than just eval'd).

> Huh?  You don't want it compiled -- that's the point.

By "compiled" I only mean that it goes through the byte-compiler (before
being eval'd).  Not that the resulting byte-code is written in the
output file.

If the content of eval-when-compile were not compiled, then
(eval-when-compile (defvar foo)) would be 100% equivalent to a nop.
It's only because it's both compiled&eval'd that the byte-compiler notices
the defvar and thus silences warnings about subsequent uses of
this variable.

> You're actually considering changing what eval-when-compile does and
> breaking more existing code??

Compiling the content of eval-when-compile before eval'ing doesn't
remove/hide any bug AFAIK, quite the opposite.


reply via email to

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