What can you do in LISP that you can't do in Python

Darren New dnew at san.rr.com
Wed May 16 12:14:49 EDT 2001


Thomas Bellman wrote:
> Parsing and executing is two entirely different things.  I was
> not talking about just passing a bit of code to an 'execute'
> procedure (which is called eval in LISP, exec in Python, and
> I-don't-know-what in TCL); I was talking about parsing the code
> in order to be able to modify it.  You don't get that for free
> just because you have the code in a string and the 'execute'
> procedure takes a string as its argument.

Parsing is very simple in Tcl, since virtually everything you would want
to do parsing-wise is exposed at the programmer level and the language
syntax is trivially simple. It's easy to go through a chunk of code and
do the same sorts of modifications you do with Lisp macros. Just as Lisp
gives you handy routines for getting sub-chunks of strings that are
inside parens, Tcl gives you handy routines for getting sub-chunks of
strings that are inside braces. (They're called "lists" in Tcl, see. ;-) 

Personally, I've never had the need or seen anyone's code that munged
the middle of a piece of executable code in Tcl. There are better ways
of doing it, such as appending extra arguments to the end of a call or
passing in a list of executable chunks.

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
       San Diego, CA, USA (PST).  Cryptokeys on demand.
     This is top-quality raw fish, the Rolls-Rice of Sushi!



More information about the Python-list mailing list