help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Macro Expansion Inconsistency


From: Alexander Shukaev
Subject: Re: Macro Expansion Inconsistency
Date: Wed, 17 Dec 2014 17:01:51 +0100

>
> Not just "probably the best" -- this is the ONLY way to go in macros.
> The whole point of macros is to produce new code to be evaluated in
> place of the original code.
>
> The important thing to remember about macros is that they run when
> you're COMPILING the code, not when you run it. These may be
> approximately the same time if you evaluate the calling code (e.g. by
> typing it into the *scratch* buffer, loading the source file, M-x
> eval-region). This is why calling eval seems to work when you're testing
> the macro interactively.
>
> But if you byte-compile the file, it will be run then, not when you
> later load the .elc file. This will usually be a totally different Emacs
> session, so it should be obvious why the results of calling eval won't
> be available then.


​Nice explanation, it indeed does make sense. Thank you.​


reply via email to

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