Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a6c5990a8c56d60e8b52d8df29d244f9839b4bc9
Ticket: 1165671fffffffffffffffffffffffffffffffff
inefficient bytecode for [incr x -1]
User & Date: dgp on 2005-03-17 23:42:19
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    During the CONST reforms leading up
    to Tcl 8.4 that allowed const strings
    to be passed to Tcl_Eval(), etc...
    a call to TclLooksLikeInt() was replaced
    by TclParseInteger() in the
    TclCompileIncrCmd() routine.
    
    TclLooksLikeInt() allows for leading
    whitespce and + and -, while TclParseInteger()
    does not.  So the test doesn't pass as
    often as it used to, or as it should.
    When the test passes, immediate
    operands are compiled into the
    bytecode allowing for more efficient
    execution.
    
    As it happems, TclLooksLikeInt()
    is happy and safe to use with const
    strings.  The attached patch restores
    it, which allows increments containing
    whitespace and leading sign characters
    to be compiled to more efficient bytecode.
    The most notable case is probably
    [incr x -1].  Will be interesting to see if
    this change shows up in any benchmarks.
    
  4. foundin changed to: "obsolete: 8.4.9"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "47. Bytecode Compiler"
  10. title changed to: "inefficient bytecode for [incr x -1]"
  11. type changed to: "Bug"