Skip to content
Tcl Source Code History Of Ticket 3107983
Login

History Of Ticket 3107983

Artifacts Associated With Ticket 3107983

  1. Ticket change [3f214dfb0b] (rid 121399) by avl42 on 2010-11-12 15:32:45:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "avl42"
    10. subsystem initialized to: "47. Bytecode Compiler"
    11. title initialized to: "Glitch in the constant expression optimization."
    12. type initialized to: "Bug"
  2. Ticket change [a2ead95911] (rid 109973) by ferrieux on 2010-11-12 22:34:54:

    1. icomment:
      Analysis at http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/c7888bc3ee8b7ad8/cbe4abc6190e7727#cbe4abc6190e7727
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  3. Ticket change [80396953d5] (rid 97701) by ferrieux on 2010-11-12 22:44:52:

    1. 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.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [18ba239b94] (rid 122707) by avl42 on 2010-11-12 22:49:08:

    1. icomment:
      My preference would be for (2).
      
      
    2. login: "avl42"
    3. mimetype: "text/plain"
    4. username: "avl42"
  5. Ticket change [c4d3de3fe8] (rid 111902) by dgp on 2010-11-12 22:55:54:

    1. assignee changed to: "dgp"
  6. Ticket change [1d297a177f] (rid 90750) by avl42 on 2010-11-12 22:56:41:

    1. assignee changed to: "msofer"
    2. 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".
      
      
      
    3. login: "avl42"
    4. mimetype: "text/plain"
    5. username: "avl42"
  7. Ticket change [6a1dda1c75] (rid 128088) by dgp on 2010-11-18 03:21:50:

    1. 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.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [7585b31753] (rid 105404) by dgp on 2010-11-18 03:27:28:

    1. icomment:
      Heh.  TIP 232 *also* says:
      
      "There is no longer any restriction [on functions] ...
       that their arguments and results must be numeric."
      
      Hoo boy.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [1f64fb00f3] (rid 91139) by ferrieux on 2010-11-18 04:25:38:

    1. icomment:
      Then, the tryCvtToNumeric emitted at the end of each [expr] is ... unwanted ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  10. Ticket change [fe9ad230ca] (rid 108618) by dgp on 2010-11-18 04:37:41:

    1. 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.
      
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  11. Ticket change [01c9c381da] (rid 119544) by msofer on 2011-01-31 19:40:03:

    1. assignee changed to: "dgp"