[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compiler macros without byte-compilation
From: |
Stefan Monnier |
Subject: |
Re: compiler macros without byte-compilation |
Date: |
Fri, 20 Mar 2015 09:42:06 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> => ((lambda nil (message "Done !")) "compiler-macro")
> Now I'm puzzled : why does this happen ? foobar wasn't compiled here !
The exact cases where compiler-macros are used are unspecified and
likely to change between versions.
If you want to know the details: compiler-macros are expanded by
macroexpand-all. So everytime we rely on macroexpand-all (i.e. "eager"
expansion) rather than on macroexpand (i.e. "lazy" expansion), compiler
macros will be expanded.
"Lazy" macroexpansion is on the way out: `eval' does not call
macroexpand-all (because it can happen that `eval' is called repeatedly
in a tight loop to evaluate very short code sequences, where going
through macroexpand-all might be detrimental for performance), but
pretty much all other paths to `eval' do or should (i.e. `load',
`eval-region', ...).
Stefan