by ZoFreX · 13y ago · 0 comments
The latter trips me up far more than I would like to admit :(
It's a great example of the nature of Tcl as a language, though. Sometimes I love the simplicity, sometimes consequences of it drive me nuts.
For those who haven't used Tcl: You write comments like this:
# this is a comment
But, in keeping with Tcl's simple and tiny nature, this isn't a special case. "#" is simply a procedure that ignores all arguments supplied to it!While this is extremely elegant, and means you could implement comments in Tcl itself rather than the interpreter, it does mean that you have to balance your curly brackets within comments, which is hugely annoying when you forget.
for {set i 0} {$i<$n} {incr i} {
# Some comment
for {set j 0} {$j<$n} {incr j} {
The script refused to run and eventually I figured out that the comment was somehow impeding execution. I still don't understand why. proc some_proc {a b} {
} # some_proc proc some_proc {a b} {
} ;# some_proc