Skip to content
Tcl Source Code History Of Ticket 1064135fffffffff
Login

History Of Ticket 1064135fffffffff

Artifacts Associated With Ticket 1064135fffffffff

  1. Ticket change [a779ec4168] (rid 98803) by alove on 2004-11-10 21:33:29:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Note: if you are going to delete this, please email me at 
      [email protected] and let me know why.  Thanks.
      
      SUMMARY: The EXPR command in its regular form 
      performs two substitutions: one by the Tcl parser and 
      one by the EXPR command itself.  But in practice, the 
      TCL parser is rarely needed; almost all EXPR commands 
      are coded with double-braces to improve performance.  
      This is a main contributor to  "quoting hell" when using 
      TCL:
      
      set var [expr {$a*25}]
      set speed [expr {($a+$b)/75}]
      
      create line [expr {$a+2}] [expr {$a2+7}] \
      [expr {$a+$bh-2}] [expr {$b2+$a+3}] 
      
      Rather than using more quotes to give a single 
      substitution and more speed, I propose a new command 
      called XP, which is identical to EXPR with double braces.  
      Using this command, the above code would look like this:
      
      set var [xp $a*25]
      set speed [xp ($a+$b)/75]
      
      create line [xp $a+2] [xp $a2+7] \
      [xp $a+$bh-2] [xp $b2+$a+3] 
      
      The third line saves 16 characters of typing, including 
      eight double-braces that require the shift key.
      
      IMPLEMENTATION: This command would be identical to 
      EXPR except that it would skip the TCL parser.  For 
      demonstration, you can simulate the command (but not 
      its speed) using
      
      proc xp {a} { eval expr { $a } } 
      
      (This proc works only if you exclude spaces from the 
      expression, which is why the above examples have no 
      spaces.)
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "alove"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to: "EXPR single substitution"
    11. type initialized to: "RFE"
  2. Ticket change [1842a78525] (rid 122631) by dkf on 2004-11-11 16:36:03:

    1. closedate changed to: "2004-11-11T09:36:03"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      Duplicate of 1062849
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Duplicate"
    7. status changed to: "Deleted"
    8. username: "dkf"