Re: Comments on "Why you should not use Tcl"

Wayne Throop (throopw%sheol.uucp@dg-rtp.dg.com)
27 Sep 1994 16:05:14 GMT

:: Tcl has a peculiar syntax that appeals to hackers because of its
:: simplicity. But Tcl syntax seems strange to most users.

: From: asah@cs.Berkeley.EDU (Adam Sah)
: A stronger argument can be made: Tcl supports a single level of
: substitution, confusing nearly all new users of the language.
: [...] "expr $a+5" is not the same as "expr {$a+5}"

But it is not at all clear to me that this is tcl's "fault". Tcl has
the property of lexical locality, that is, you can tell from local
inspection how many arguments a command will receive, even when text
substitution is going on. I think that the "only" people who are
confused by this are those who become familiar with the unix shells'
notion of how to expand foo $bar , and try to take up using tcl without
reading the tcl.n manpage. Because, sure enough, tcl treats foo $bar
differently than unix shells treat it. But shell quoting syntax, along
with the associated home game of "guess how many times this will be
rescanned before eval", cause endless grief in writing shell programs,
and tcl was correct to try to change this behavior.

I mean, how many people, in lisp, "expect" to be able to something like

(setq foo (list a b)) (foo (quote bar))
(bar foo) or
and have it mean
(bar a b) (foo bar)

Not many, perhaps, but that's only because they haven't been exposed to
some similar syntax that *does* so such bizare things first. Further,
many things about lisp's expression-oriented style "confuses nearly all
new users of the language" (if they formerly used more side-effect driven
languages from the Algol family). But that doesn't mean that the
expression-oriented style is in any way "at fault", or deserving of change.

If you've been pounding nails with your forehead for years, it may feel
strange the first time somebody hands you a hammer. But that doesn't
mean that you should strap the hammer to a headband just to give your
skull that old familiar jolt.

In other words, I'm claiming that, over the slightly longer haul,
tcl's single-level regularized text expansion/rescanning rules are
at worst a miswart, and are arguably a distinct feature.

And further, to discard this particular feature of tcl in any shell-like
replacement is probably a mistake.

--
Wayne Throop   throopw%sheol.uucp@dg-rtp.dg.com
               throop@aur.alcatel.com