Why is tcl broken?

Tim Bradshaw tfb at tfeb.org
Wed Jun 30 15:26:00 CEST 1999


 Paul Duffin <pduffin at mailserver.hursley.ibm.com> writes:

> I am surprised at this because Tcl's [upvar] is simply an explicit form
> of dynamic binding which I seem to remember is what Lisp uses. (That
> is how the 'let' function can be (is) implemented as a lambda function).

No, (Common) Lisp doesn't use dynamic binding by default, and you
don't need anything like upvar to implement LET.  In fact LET is
really the most common case of a lisp design pattern -- `WITH-x ->
CALL-WITH-x:

	(let ((a b)) . body)
     -> ((lambda (a) . body) b)

(Writing the macro for this is a little fiddly if you want to get it
right in all cases, but not more than 10 minutes work.)

> I find that Lisp macros (while a very powerful and necessary mechanism)
> are sooo confusing. They are in essence another language inside Lisp,
> and as such introduce inconsistencies. Tcl on the other hand doesn't
> need a macro language and as such is much more consistent than Lisp.

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.

--tim







More information about the Python-list mailing list