[Python-Dev] A Hygienic Macro System in Python? (original) (raw)

Juergen Hermann Juergen Hermann" <j.her@t-online.de
Mon, 18 Mar 2002 23:34:44 +0100


On Mon, 18 Mar 2002 16:45:09 -0500, Guido van Rossum wrote:

More use cases please! (Unless you give up now. :-)

My major use case for (simple) macros would be AOP (aspect oriented programming), where calling a function can hurt you, especially for aspects like "do this on a development system, but not on the production system".

Currently, you need things like this:

if do_debug:
    some costly things

main code

if do_debug:
    collect info and write to log or something

So, instead of adding macros, might we think about a Pythonic (and efficient!) way to add aspects to the language?

Ciao, J=FCrgen