Macros in Python, and using reg exps to build a scheme interpreter

Alex Martelli aleax at aleax.it
Thu Oct 31 16:50:14 EST 2002


Peter L. Markowsky wrote:

> Hi,
> 
> Currently in one of my classes I'm building a scheme interpreter
> in Java. This has brought two questions to mind. First does python use
> language macros to define higher level functionality.

No.  See http://tinyurl.com/2csr (tinyurl to a 62-post flamewar of
particularly venomonous proportions as archived on Google) and many
other less-venomonous past threads for the why's and how's.


> And two does anyone
> know a good place to look for how to implement a scheme parser using
> regular expressions?

If I recall correctly, strictly speaking, regular expressions cannot
parse a language with unlimited depth of nesting.  RE's with the many
extensions that Python borrowed from Perl, and embedded in a richer
language, of course, may be able to.  But the simplest and fastest
approach is most likely to be one NOT using RE's, I would guess.


Alex




More information about the Python-list mailing list