Macros in Python? (was Re: Python or Java or maybe PHP?)

Aahz aahz at pythoncraft.com
Tue Jan 3 16:44:37 EST 2006


In article <86zmmdf1hp.fsf at bhuda.mired.org>, Mike Meyer  <mwm at mired.org> wrote:
>aahz at pythoncraft.com (Aahz) writes:
>> In article <1136285678.276857.268840 at g43g2000cwa.googlegroups.com>,
>> James <fphsml at gmail.com> wrote:
>>>
>>>I keep asking myself why isn't this more popular especially when many
>>>prominent Python devs seem to be well aware of Lisp where macros are
>>>done right. 
>>
>> You have confused "many Python devs" with Guido.  ;-)  Guido hates
>> macros.
>
>I vaguelly recall hearing that Guido thought about adding macros to
>Python, and rejected the idea because he didn't want users to have to
>deal with compile-time errors at run time. Or something to that
>effect.
>
>That doesn't sounds like "hates" to me. More like "doesn't like the
>baggage."

The smiley applies to that whole bit.  Guido's main problem with macros
is that there's no clean way to integrate them into a language with
strong syntactical structure.  He also doesn't like the idea of splitting
Python itself into mini-languages (by adding new keywords).  He does have
a strong distaste for functional programming and sees macros as partly an
attempt to expand inappropriate usage of functional programming in
Python.

Plus your point, that probably covers most of it.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Given that C++ has pointers and typecasts, it's really hard to have a
serious conversation about type safety with a C++ programmer and keep a
straight face.  It's kind of like having a guy who juggles chainsaws
wearing body armor arguing with a guy who juggles rubber chickens wearing
a T-shirt about who's in more danger."  --Roy Smith



More information about the Python-list mailing list