Artifacts Associated With Ticket 3107983
Ticket change [3f214dfb0b] (rid 121399) by avl42 on 2010-11-12 15:32:45:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% proc tcl::mathfunc::foo x { puts "foo:>>>$x<<<"; return $x } % set x 1; expr {foo($x?" 0x42 ":" 0x41" )} foo:>>> 0x42 <<< 66 % expr {foo(1?" 0x42 ":" 0x41" )} foo:>>>66<<< 66 % If the condition is a constant, then the result of the "?:" operator is numericalized even if it gets passed to an external function. - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "avl42"
- subsystem initialized to: "47. Bytecode Compiler"
- title initialized to: "Glitch in the constant expression optimization."
- type initialized to: "Bug"
Ticket change [a2ead95911] (rid 109973) by ferrieux on 2010-11-12 22:34:54:
- icomment:
Analysis at http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/c7888bc3ee8b7ad8/cbe4abc6190e7727#cbe4abc6190e7727
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [80396953d5] (rid 97701) by ferrieux on 2010-11-12 22:44:52:
- icomment:
Two possible decisions: (1) stick to the convert-to-numeric spirit, and add extra TryCvtToNumeric on entry to user-provided mathfuncs (2) decide it is over-eager, and keep it only on entry to built-in numerics. Remove it from end-of-expr. I guess (1) is more gentle, as it keeps compatibility. (2) may sound harsh, but it would be more EIAS-ly.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [18ba239b94] (rid 122707) by avl42 on 2010-11-12 22:49:08:
- icomment:
My preference would be for (2).
- login: "avl42"
- mimetype: "text/plain"
- username: "avl42"
- icomment:
Ticket change [c4d3de3fe8] (rid 111902) by dgp on 2010-11-12 22:55:54:
- assignee changed to: "dgp"
Ticket change [1d297a177f] (rid 90750) by avl42 on 2010-11-12 22:56:41:
- assignee changed to: "msofer"
- icomment:
...but that might require a TIP, so the bug-fix probably should only change the particular shortcut-route to not use "expr" for pre-calculation, but perhaps some (for now internal) "expr-without-tryCvtToNumeric".
- login: "avl42"
- mimetype: "text/plain"
- username: "avl42"
Ticket change [6a1dda1c75] (rid 128088) by dgp on 2010-11-18 03:21:50:
- icomment:
According to TIP 232, "The [expr] command shall be modified so that an expression of the form: f(arg1,arg2,...) shall generate code equivalent to that generated by [tcl::mathfunc::f [expr { arg1 }] [expr { arg2 }] ...] " This means the constant optimizer case is actually getting this done as prescribed, and it's the non-constant case which is buggy. The mathfunc.n manpage isn't quite as explicit, but suggests the same thing. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [7585b31753] (rid 105404) by dgp on 2010-11-18 03:27:28:
- icomment:
Heh. TIP 232 *also* says: "There is no longer any restriction [on functions] ... that their arguments and results must be numeric." Hoo boy.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [1f64fb00f3] (rid 91139) by ferrieux on 2010-11-18 04:25:38:
- icomment:
Then, the tryCvtToNumeric emitted at the end of each [expr] is ... unwanted ?
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [fe9ad230ca] (rid 108618) by dgp on 2010-11-18 04:37:41:
- icomment:
I just know the issue of passing strings to/from functions was raised and discussed when the feature was in dev or new, but I cannot find it.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [01c9c381da] (rid 119544) by msofer on 2011-01-31 19:40:03:
- assignee changed to: "dgp"