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

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

bug#40827: 28.0.50; Macroexpansion at runtime


From: Stefan Monnier
Subject: bug#40827: 28.0.50; Macroexpansion at runtime
Date: Sat, 25 Apr 2020 16:04:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> Occasionally problems result from the fact that a macro call is
>>> expanded each time it is evaluated in an interpreted function, but is
>>> expanded only once (during compilation) for a compiled function. If
>>> the macro definition has side effects, they will work differently
>>> depending on how many times the macro is expanded.

We could be more nuanced, indeed, since the "expanded once" can also
happen for interpreted code (and the "expand many times" can also happen
in code that's in a compiled file, if that code happened to be "hidden"
from the compiler, such as hidden within a `quote`).

But the basic idea remains the same: macro expansion may happen only
once as part of the preprocessing, or it may be performed anew each time
the code is run (or anything in-between, really), so the code should not
make assumptions about when macros are expanded or how many times
they're expanded.


        Stefan






reply via email to

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