Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cb7723a824beb250283540c1d7752fe9c9bf240b
Ticket: 447296ffffffffffffffffffffffffffffffffff
commented if statement are evaluated
User & Date: msofer on 2001-08-03 04:48:39
Changes

  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"