Why is Python popular, while Lisp and Scheme aren't?
Cameron Laird
claird at lairds.com
Fri Nov 8 16:46:23 EST 2002
In article <20021108.135935.824272813.9010 at cybermesa.com>,
Jay O'Connor <joconnor at cybermesa.com> wrote:
.
.
.
>No, I'm making the point that TCL is syntactically weaker at expressing
>complex structures and this is a qualitative difference between the two
>languages
>
>Expanding beyond just getting a single value from a multidimensional list
>is what happens when you start throwing in lrange for slicing and other
>ways of unwrapping the structure. TCL's approach of using 'functionName
>$var1 var2' leads quite easily and naturally to such 'monstrosities' as a
>natural consequence of the stucture of the language. When you start
>throwing in heterogenous structures, especially dealing with nested
>arrays (dictionaries) , etc..the syntactical shortcut doesn't scale very
>well to dealing with complex data. (incidentally, your example does not
>do the same thing.
>
>set l1 "1 2 3"
>set l2 "4 5 6"
>set l3 [list $l1 $l2]
>set x [lindex [lindex $l3 1] 1]
>puts $x
>
>results in '5'
>
>using 'set x(1,1)
>results in an error
Yes and no. Tcl is awful for structuring data
complexly in analogy to C. It's at least medi-
ocre, though, at handling complex data in its
own idioms.
Yes, I fully understand that "set x(1,1)" above
gives an exception. I'm saying that all the
well-crafted systems for managing matrices in
Tcl do NOT just make them as nested lists. One
possibility for a nicely-engineered Tcl matrix
handler is to refer to the "upper left" element
as "x(1,1)". I'm sorry that your co-workers
imposed such an unaesthetic misuse of Tcl as you
describe on you.
<URL: http://wiki.tcl.tk/2995 > has more on the
subject.
.
[Jay and Cameron talk
past each other more]
.
.
--
Cameron Laird <Cameron at Lairds.com>
Business: http://www.Phaseit.net
Personal: http://phaseit.net/claird/home.html
More information about the Python-list
mailing list