No macros in Python

Miki Tebeka tebeka at cs.bgu.ac.il
Tue Dec 17 09:56:06 EST 2002


Hello Peter,

> > Python doesn't have macros. On the other hand, looking at the world
> > through OO glasses rather than S-expression glasses means you don't
> > need macros as often. But the topic comes up at irregular intervals,
> > so someone may eventually come up with a way of doing macros in Python
> > that is right - at which point it'll be added.
> 
> I haven't heard this expressed as a disadvantage very often, perhaps
> not before in this group since I've been reading it.
> 
> In what way would macros (as I understand them... from C for example)
> improve Python, other than possibly a small improvement in performance?

I think reading http://www.paulgraham.com/onlisp.html helped me best
to understand
what macros can do.

The biggest problem adding them to Python as I see it is the syntax of
Python.
However I'm sure someday some clever will find a way around it, maybe
a a pre processor one first round.

Miki



More information about the Python-list mailing list