No macros in Python

Laura Creighton lac at strakt.com
Mon Dec 16 02:45:12 EST 2002


> Which brings up the primary argument people have against macros. By
> changing the syntax of the language, they make it impossible to
> understand a program by local examination. You have to know what
> macros are in scope and thus might change the programs behavior. Then
> again, the ability to redefine operators does much the same
> thing. Which is why I don't buy the "they'll never be added because
> they are inherently evil" argument. The two are equally evil, for the
> same reasons. We've got one. Why not the other?

The reason isn't technical, its sociological.  People do not sit up nights
inventing thousands of new operators to insert in their code.  For some
reasons, our brains don't work that way.  [Right.  I see you Mr.Smarty
Pants in the back row, waving his hand, wanting to show me his
Calculator-From-Hell Program.  Not today, please ...]  This is not
the case for a macro system that let you get the language, 'just
Right' ... i.e. what you think that Guido would have done if he had
it to do over again, not rushed, and with all the accumulated wisdom you
travel around in your head with, or if he had started with the goal of
making Python easier to learn for FORTRAN programmers ...

Writing your own Lisp Macro System is better than sex.  I _know_ -- 18 year
old me turned down _lots_ of opportunities for sex to go hack on her
macro system.  Thus if we introduce this to the language, I think that it
is _inevitable_ that we will fragment the Python community into a
plethora of mutually unintelligble dialects.  I don't want this.  Thus
I don't want a macro facility in the language _because_ it would be so cool.

Laura Creighton





More information about the Python-list mailing list