No macros in Python

Erik Max Francis max at alcyone.com
Wed Jan 1 14:30:48 EST 2003


Bruce Hoult wrote:

> In article <x78yyqiwle.fsf at guru.mired.org>, Mike Meyer <mwm at mired.org>
> wrote:
>
> > C macros are a very poor example of the species. I was referring to
> > lisp-like macros, where you get the full functionality of the
> > language
> > to manipulate the code that the macro is dealing with.
> 
> That's pretty cool, and the most flexible it's possibel to get, but I
> think it's overkill for most cases, and not always the easiest to
> write
> or to understand.

As I've said before, I think if really what you want is the equivalent
power of Lisp macros, since Python is interpreted, a better approach
would be to write a metainterpreter that took whatever additional
constructs you wanted to add and then processed them into Python which
you could then run as a separate script.

It just seems to me that if you want that level of power in this day and
age, there are less intrusive ways to do it.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ The love we give away is the only love we keep.
\__/ Elbert Hubbard
    Bosskey.net / http://www.bosskey.net/
 A personal guide to online multiplayer first person shooters.




More information about the Python-list mailing list