Skip to content
Tcl Source Code History Of Ticket 1489011fff
Login

History Of Ticket 1489011fff

Artifacts Associated With Ticket 1489011fff

  1. Ticket change [5ab639ab92] (rid 118190) by dgp on 2006-05-15 17:43:52:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      dgpIn Tcl 8.4, the only way to create a new math
      function is via Tcl_CreateMathFunc
      
      [13:17]dgpUsing that interface, the return type of
      the function had to be ont of the supported C types of
      the Tcl_Value struct.
      
      [13:18]dgpso mathfuncs were only good for computing
      numerical things
      [13:18]tclguyyes
      [13:18]dgpWith TIP 232 in place, that restriction is
      lifted...
      
      [13:20]dgp% proc tcl::mathfunc::append {args} {
      return [join $args ""]             
      }
      % expr {append("foo","bar","soom")}
      foobarsoom
      
      [13:21]dgpIs this new ability an intended
      improvement?  Or an unintended implementation consquence?
      [13:21]dkf_dgp: improvement 
      [13:22]dkf_I don't know about "intended" though
      [13:22]dgpdon't judge too quickly... 
      
      [13:23]dkf_What I can say is that I know how bad it
      was before, having tried to write new functions using
      that old API
      [13:23]dgp% expr {append("N","a","N")}
      domain error: argument not in valid range
      
      [13:24]dgpif the [expr] core is supposed to check for
      numeric-ness of the result of a function, then
      screening out NaN's might make sense.
      [13:24]dgpbut if we intend string functions to work,
      we need to stop doing that.
      [13:25]dkf_Earlier on, I said that NaN was "the
      screaming horror hiding in the space between the 1s and
      the 0s" and I meant it
      
      [13:26]spjuthTry: expr {append("0","x","AF")}
      [13:26]dgpsame interp:
      % expr {sqrt(-1)}
      NaN(7ffffffffffff)
      [13:26]dgpso either way, the HEAD is currently
      buggy/inconsistent
      [13:26]dkf_it's the cvtToNumeric opcode that's wacky
      [13:26]dgpbut I'd like to know my opinions about
      which way correctness lies aren't in gross conflict
      with others.
      [13:27]dgp% expr {append("0","x","AF")} 
      175
      [13:30]dkf_What would fail if line tclCompExpr.c:260
      was commented out?
      [13:30]dgpI'll test and find out...
      [13:30]dkf_since I think that's what is causing the
      problem
      [13:32]dgpwhy is that line inactive in the sqrt()
      example?
      [13:32]dkf_probably a buggy INST_TRY_CVT_TO_NUMERIC
      implementation
      
      [13:34]dgpdkf, mucho failures regarding string rep of
      numbers
      [13:34]dgp[expr] apparently is supposed to produce
      canonical string reps
      [13:35]dgp% expr 0x1  
      1
      
      spjuthMight be that sqrt(-1) contains a unary minus
      operator, thus INST_TRY_ is skipped.
      
    4. foundin initialized to: "obsolete: 8.5a5"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "47. Bytecode Compiler"
    10. title initialized to: "mathfuncs return strings? numbers?"
    11. type initialized to: "Bug"
  2. Ticket change [49d4fd3744] (rid 100109) by kennykb on 2006-07-31 05:53:45:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=99768
      
      Ouch. I don't know, either.  When I put the TIP together,
      I was thinking only of the new numeric types (chiefly
      bigints) and not of strings.
      
      It's obvious that we should try to convert a string to
      numeric if we pass it into something (such as an arithmetic
      operator) that requires a number.
      
      It's also a historical fact that people use [expr {$x}]
      to make $x into a canonical number - it is expected that
      [expr 0xff] will return 255.
      
      So it appears, for well or ill, that [expr] is for numbers,
      and not for strings, as attractive as the latter seems.
      Perhaps we should TRY_CVT_TO_NUMERIC on the result of
      math functions?
      
      
    3. login: "kennykb"
    4. mimetype: "text/plain"
    5. username: "kennykb"
  3. Ticket change [2927b14807] (rid 88823) by dgp on 2006-09-01 03:14:38:

    1. closedate changed to: "2006-08-31T20:14:38"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      
      This is now a Dup of 1541274
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Duplicate"
    7. status changed to: "Closed"
    8. username: "dgp"