do...until wisdom needed...

Douglas Alan nessus at mit.edu
Wed Apr 18 16:29:36 EDT 2001


Jeremy Hylton <jeremy at digicool.com> writes:

> While I think I would like to see a good program-generating technique
> for Python, I can't see how to make it work well because Python
> doesn't have any data structures for representing Python programs
> other than code objects and strings.  Neither seems useful for
> quasiquotation.

You don't need quasiquotation to do a decent macro system.
Quasiquotation just makes it easier to write really complicated
macros.  For instance, the kind of macros you want to write if you are
implementing CLOS.  People made do without quasiquotation for a long
time.

Regarding Python not having data structures for representing Python
programs -- well yes, new ones would have to be spec'ed.  Is it worth
the trouble?  I don't know.  But it's not the black and white issue
that some people would have you believe.  You can do wonderful things
with Lisp-like macros, but they do make the language somwhat bigger.
Also, people *can* abuse them.

I vehemently disagree with the philosophy that a language should not
include a very useful feature because some people might abuse it.  I
don't want a language run by language Nazi's, thank you.  On the other
hand, I am very sympathetic to the position that you should consider
with great care the complexities that you add to a language.
Especially if they might interact with each other in subtle ways.

|>oug



More information about the Python-list mailing list