GNU bug report logs - #40827
28.0.50; Macroexpansion at runtime

Previous Next

Package: emacs;

Reported by: Omar Antolín Camarena <omar <at> matem.unam.mx>

Date: Fri, 24 Apr 2020 19:11:02 UTC

Severity: normal

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Omar Antolín Camarena <omar <at> matem.unam.mx>, 40827 <at> debbugs.gnu.org
Subject: bug#40827: 28.0.50; Macroexpansion at runtime
Date: Sat, 25 Apr 2020 16:04:49 -0400
>>> 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





This bug report was last modified 3 years and 280 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.