Version 0 of Tcl warts

Updated 2001-06-21 11:05:56

Purpose: to detail some of the places where interacting with Tcl leads one to frustration, confusion, aggrevation, anger, hatred, ... (you get the idea...)


glob: the need to somehow quote the glob {} combination so that one gets the quotes passed on to glob. Use quotation marks (") or braces around the arguments to get them pass the parser.

Regular expressions: a similar problem - the need to quote arguments appropriately so that various regular expression metas make it through the tcl parsing.

Tcl comments: Why can I not place unmatched braces in Tcl comments

Tcl hashes vs arrays: Sometimes people attempt to simulate 2 or more dimensions of arrays using the Tcl associated hashes (aka tcl arrays). The gotcha here is that because the array index is a string, white space is significant.

 $ set a1(1,2) abc
 abc
 $ puts $a1( 1,2)
 can't read "a1( 1,2)": no such element in array
 while evaluating {puts $a1( 1,2)}

Another gotcha here is trying to set arrays with white space:

 $ set a1( 1,2) abc
 wrong # args: should be "set varName ?newValue?"
 while evaluating {set a1( 1,2) abc}

You need to use quotes if you are putting space into that variable.