4 ms·
I use Tcl for a number of analysis scripts inside some scientific software. Recently, I came across a situation in which I had nested loops: for {set i 0}
by rotskoff 14y ago
I use Tcl for a number of analysis scripts inside some scientific software. Recently, I came across a situation in which I had nested loops:
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.
- engtech 14y agoThis also breaks, because comments are syntax. proc some_proc {a b} { } # some_proc
- ZoFreX 14y agoThat's easier to explain though - you are passing the arguments {a b} { } # and some_proc to the procedure some_proc. Because comments are just another command, the # has to be the first non-whitespace character on the line.
- vorg 14y agoBased on the instructions in the article (tho I haven't tried it out), putting a semicolon before the hash would work... proc some_proc {a b} { } ;# some_proc
- ZoFreX 14y agoAre you sure the comment didn't have some curly brackets in it or something like that?