Skip to content
Tcl Source Code History Of Ticket 1e95cbaf89
Login

History Of Ticket 1e95cbaf89

Artifacts Associated With Ticket 1e95cbaf89

  1. Ticket change [e21af53233] (rid 137483) by Grumpy Coder on 2014-04-04 04:30:01:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      So I decided to stop living in the past and upgraded from Tcl 8.4 to 8.6. And got bitten by something that used to work just fine:
      
      First, the expected behavior:
      
      tclsh8.6
      % set tcl_patchLevel
      8.6.1
      % set comment "#fubar snafu"
      #fubar snafu
      % lindex $comment 0
      #fubar
      % eval $comment
      % 
      
      Now the same thing with a list. Note that in Tcl 8.4, the commands below worked identically to the above.  Not so in 8.6:
      
      % set comment [list #fubar snafu]
      {#fubar} snafu
      % lindex $comment 0
      #fubar
      % eval $comment
      invalid command name "#fubar"
      
      Looks like a bug in parsing. The first word of the list is unquestionably this:
      
      #fubar
      
      This is clear from the result of 'lindex' and from the language rules (http://www.tcl.tk/man/tcl8.6/TclCmd/Tcl.htm):
      
      "If the first character of a word is an open brace (“{”) and rule [5] does not apply ... The word will consist of exactly the characters between the outer braces, not including the braces themselves"
      
      and
      
      "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. The comment character only has significance when it appears at the beginning of a command."
      
      Well, I do have # in first character of the first word of the command. Why is Tcl8.6 not treating it as a comment???
      
      While I don't have a newline in here, newlines are separators and I have one command to evaluate, so separator presence is moot. But let's add it:
      
      % eval "$comment\n"
      invalid command name "#fubar"
      
      Still not good.
      
      Looks like a clear bug to me.
      
    5. foundin initialized to: "8.6.1"
    6. is_private initialized to: "0"
    7. login: "Grumpy Coder"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "51e6fca6c11afbb182a55eb093d92ab68ef5a61b"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "Grumpy Coder"
    14. subsystem initialized to: "45. Parsing and Eval"
    15. title initialized to:
      Evaluating something starting with a # fails to treat it as a comment
      
    16. type initialized to: "Bug"
  2. Ticket change [0989f7c038] (rid 137500) by jan.nijtmans on 2014-04-04 12:42:22:

    1. closedate changed to: "2456752.02942464"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Well, the string you are evaluation doesn't start with "#"
      any more, it starts with "{". The reason for this change
      is explained here:
      
      [http://www.tcl.tk/cgi-bin/tct/tip/148]
      
      In short: Your script was depending on a Bug in Tcl 8.4, which
      was fixed in Tcl 8.5. Sorry ......
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Rejected"
    7. status changed to: "Closed"
  3. Ticket change [237435ed6a] (rid 137501) by jan.nijtmans on 2014-04-04 12:46:14:

    1. closedate changed to: "2456752.03211604"
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
    4. resolution changed to: "Invalid"
  4. Ticket change [6e80db10b0] (rid 138304) by Grumpy Coder on 2014-05-30 19:04:01:

    1. closedate changed to: "2456808.29446291"
    2. closer changed to: "Grumpy Coder"
    3. icomment:
      The documentation clearly states that the parsed word does not include the braces, and that whether something is a comment or not depends on the first character of the WORD, and not the first character of the STRING containing that word.
      
      If the current behavior is deemed desirable, then the documentation of the language should be fixed so that it is consistent with the behavior.
      
    4. login: "Grumpy Coder"
    5. mimetype: "text/plain"
  5. Ticket change [553ed5f22e] (rid 138306) by dgp on 2014-05-30 19:33:09:

    1. closedate changed to: "2456808.31469385"
    2. closer changed to: "dgp"
    3. icomment:
      You say "current behavior" as if it were something novel,
      and not the Tcl bug-fixed reality for more than 10 years.
      
      The change that was made in 2003 was made to make
      Tcl behave as documented.  Tcl was buggy on this point.
      Current releases now are not.
      
      This is all spelled out in TIP 148.  Tcl 8.4 was left buggy
      just to offer folks the option to adjust at their leisure.  A
      10 year grace period is far from unreasonable.  Stay with
      8.4 if you cannot accept it.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
  6. Ticket change [e23817853c] (rid 138342) by dkf on 2014-06-03 08:35:39:

    1. closedate changed to: "2456811.85809583"
    2. closer changed to: "dkf"
    3. icomment: "See [489537] for more information."
    4. login: "dkf"
    5. mimetype: "text/x-fossil-wiki"
    6. username: "dkf"