RFC -- HYGIENIC MACROS IN PYTHON

Courageous jkraska at san.rr.com
Sun Feb 10 13:03:00 EST 2002


>So I wouldn't be able to do that macro expansion. This means the macro
>processor is conceptually more complex, and therefore more difficult
>to learn and probably has more bugs in it too.

Potentially. However, hygienic macro systems are better known for
introducing less comprehensional complexity. Likewise, it's usually
easier to integrate them with the debugger. Often, they are implemented
by doing something like inserting into the parse-tree directly, which
affords the opportunity to record both expansion-point as well as
source-origin line numbers and line positions. So while these things
need to be unit tested like any other element of the language, once
done, they are fare less likely to _introduce_ hard-to-find bugs into
the user's code.

And note that in any case, the question of whether or not any macro
system is strictly _hygienic_ is distinct from its first-class
implementation.

C//




More information about the Python-list mailing list