From: SourceForge.net <no...@so...> - 2006-10-25 21:27:42
|
Bugs item #1584674, was opened at 2006-10-25 20:09 Message generated for change (Comment added) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1584674&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: 46. Bytecode Compiler >Group: current: 8.5a5 Status: Open Resolution: None >Priority: 3 Private: No Submitted By: Peter MacDonald (pcmacdon) >Assigned to: miguel sofer (msofer) Summary: where has the syntax error detection gone Initial Comment: I was trying out 8.5a5 thinking that it's new compiled switch feature would improve Tcl's detection of syntax errors in switch arms, but instead found not only is it unchanged, but that the basic error detection of "if" is now gone. For example the following script causes 8.3 and 8.4 to barf, but is perfectly legal in 8.5: proc bar var { if {$var == "acorn"} { set a b c } } bar a Ditto for proc bar var { if {$var == "acorn"} { set a [b c } } The "no errors til you execute it" policy means you need nearly perfect code coverage testing to use Tcl with any confidence. ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2006-10-25 22:27 Message: Logged In: YES user_id=79902 Because you can do some horrible hacks like this now: rename if if_ proc if args { foreach a $args {puts $a} } bar var rename if {} rename if_ if OK, that's rather odd code, but it's legal. If you want static syntax checking, use a third-party tool like Nagelfar. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1584674&group_id=10894 |