Skip to content
Tcl Source Code History Of Ticket 447296ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 447296ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 447296ffffffffffffffffffffffffffffffffff

  1. Ticket change [344a166618] (rid 106736) by nobody on 2001-08-02 19:45:10:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
    4. foundin initialized to: "obsolete: 8.3.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "None"
    10. title initialized to: "commented if statement are evaluated"
    11. type initialized to: "Bug"
  2. Ticket change [cb7723a824] (rid 95523) by msofer on 2001-08-03 04:48:39:

    1. assignee changed to: "msofer"
    2. 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.
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. subsystem changed to: "45. Parsing and Eval"
    6. username: "msofer"
  3. Ticket change [82d1e675e9] (rid 117293) by msofer on 2001-08-03 05:23:57:

    1. closedate changed to: "2001-08-02T22:23:57"
    2. closer changed to: "msofer"
    3. 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
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "msofer"