To talk about Donal's answer, Tcl does not find errors at compile time, because in general it cannot be done, any code executed before if could override the if command, so it can be valid, the only way to determine if it is this is to run the code (i.e. this is a problem with stopping)
consider this script:
gets stdin input if {$input == "fail"} { rename if if_ proc if {arg1 arg2 arg3} { puts "ha ha" } } if {1} { puts "success"}
it is clearly impossible to statically determine if line {1} has the correct number of arguments without running the program
TCL really has virtually no syntax, there is nothing that the compiler can check, the best you can do is Lint style warnings, which will only be accurate in some cases
source share