Artifacts Associated With Ticket 447296ffffffffffffffffffffffffffffffffff
Ticket change [344a166618] (rid 106736) by nobody on 2001-08-02 19:45:10:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Code snippet: if {<conditional1>} { <action1> #} elseif {<conditional2>} #<action2> } else { <action3> } Problem: If <conditional2> is true in above if statement, <action3> will not execute. Nothing happens instead. It appears that <conditional2> is being evaluated, but <action2> is being ignored as commented code. I don't know if this occurs with other conditional statements. Expected: Since <conditional2> is commented out, it should be ignored and not evaluated. OS:Solaris 5.8 for SPARC. Tcl version:8.3.2 - foundin initialized to: "obsolete: 8.3.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "None"
- title initialized to: "commented if statement are evaluated"
- type initialized to: "Bug"
Ticket change [cb7723a824] (rid 95523) by msofer on 2001-08-03 04:48:39:
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 You are not actually commenting the ifelse clause. What is happening here is that the parser sees if expr1 body1 elseif expr2 body2 else body3 with scripts <body1> and <body2> defined as: * body1 -> \n <action1> \n # * body2 -> \n # <action2> \n The '}' after the first '#' represents the end of the script <body1>; commenting ends right there. I'm hesitant to call this a "bug", as opposed to a "mis-documented feature". The docs say (rule [9]): "If a hash character (``#'') appears at a point where Tcl is expecting the first character of the first word of a command, then the hash character and the characters that follow it, up through the next newline, are treated as a comment and ignored." Maybe the docs should be more explicit and say instead: " ..., up through the next newline or end-of-script (whichever comes first), ..." or something to that effect. However, this particular description looks even more confusing to me.
- login: "msofer"
- mimetype: "text/plain"
- subsystem changed to: "45. Parsing and Eval"
- username: "msofer"
Ticket change [82d1e675e9] (rid 117293) by msofer on 2001-08-03 05:23:57:
- closedate changed to: "2001-08-02T22:23:57"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 The man page that describes Tcl's parsing is http://tcl.activestate.com/man/tcl8.4/TclCmd/Tcl.htm Pay special attention to rule [5] I think you will find the following wiki pages very helpful: http://mini.net/tcl/1012.html http://mini.net/tcl/1669.html
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "msofer"