Language extensibility (was: Why is tcl broken?)

William H. Duquette William.H.Duquette at jpl.nasa.gov
Wed Jun 30 19:07:23 EDT 1999


On Wed, 30 Jun 1999 17:10:59 +0200, Fernando Mato Mira
<matomira at iname.com> wrote:

>
>
>Tim Bradshaw wrote:
>
>> But the language of Lisp macros is Lisp, that's really the whole
>> point!  Without knowing TCL, I find it hard to see how you can
>> introduce new constructs to the language *without* a macro language,
>> even if that language is TCL.
>
>Err.. What about Forth keywords?

Tcl is a lot like Forth, too. :-)

A Tcl command is just a procedure that can process its white-space
delimited arguments however it likes, including evaluating them as Tcl
code. There's nothing in the language but Tcl commands; the standard
control structures like "if", "for", "foreach", and "while" can
be written in Tcl.  By using the same kinds of tricks, you can
add new constructs of whatever kind you like, *provided* that
your new constructs have standard Tcl syntax.

You can do more interesting things in Lisp with readmacros,
from what I'm told, including making it look like an entirely
different language.  Tcl code always looks like Tcl code.

Will

--------------------------------------------------------------------------
Will Duquette, JPL  | William.H.Duquette at jpl.nasa.gov
But I speak only    | http://eis.jpl.nasa.gov/~will (JPL Use Only)
for myself.         | It's amazing what you can do with the right tools.




More information about the Python-list mailing list