No macros in Python
Courageous
jkraska at san.rr.com
Sun Dec 15 16:14:26 EST 2002
>I can't speak for them but I've read most mocro discussions in the
>archives and IIRC nobody ever said that all macros are evil by definition.
>Most agreed that at some cases macros can enhance code readability to a
>great extent, just any other abstraction. There is a fear that confusing
>macros will be written more frequently than good ones. For example, if
>every one breeds his own do..while, that would be bad :-). Since not
>enough motivation examples were collected so far, the developers take the
>catious approach of recieving macro ideas very calmly ;-). Meanwhile more
>macro-enthusiastic people (like me but I'm rather to the list) try to find
>the right balances for pythonic macros.
I'd be happy with an easy mechanism to make a "macro function" that
otherwise had the exact syntax of a function, but took its local
namespace from the function in which it is invoked. I haven't thought
very deeply about what this would mean, but I'm thinking a form of
closure masquerading as a function definition.
C//
More information about the Python-list
mailing list