Artifacts Associated With Ticket 1064135fffffffff
Ticket change [a779ec4168] (rid 98803) by alove on 2004-11-10 21:33:29:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- 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.)
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "alove"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "EXPR single substitution"
- type initialized to: "RFE"
Ticket change [1842a78525] (rid 122631) by dkf on 2004-11-11 16:36:03:
- closedate changed to: "2004-11-11T09:36:03"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 Duplicate of 1062849
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Duplicate"
- status changed to: "Deleted"
- username: "dkf"