Skip to content
Tcl Source Code Artifact [5ab639ab92]
Login

Artifact [5ab639ab92]

Artifact 5ab639ab9220f7cb6b0717ccb264d584046811fa:

Ticket change [5ab639ab92] - New ticket [1489011fffffffff|1489011fff] <i>mathfuncs return strings? numbers?</i>. by dgp on 2006-05-15 17:43:52.
D 2006-05-15T17:43:52
J assignee kennykb
J cmimetype text/plain
J comment \ndgpIn\sTcl\s8.4,\sthe\sonly\sway\sto\screate\sa\snew\smath\nfunction\sis\svia\sTcl_CreateMathFunc\n\n[13:17]dgpUsing\sthat\sinterface,\sthe\sreturn\stype\sof\nthe\sfunction\shad\sto\sbe\sont\sof\sthe\ssupported\sC\stypes\sof\nthe\sTcl_Value\sstruct.\n\n[13:18]dgpso\smathfuncs\swere\sonly\sgood\sfor\scomputing\nnumerical\sthings\n[13:18]tclguyyes\n[13:18]dgpWith\sTIP\s232\sin\splace,\sthat\srestriction\sis\nlifted...\n\n[13:20]dgp%\sproc\stcl::mathfunc::append\s{args}\s{\nreturn\s[join\s$args\s""]\s\s\s\s\s\s\s\s\s\s\s\s\s\n}\n%\sexpr\s{append("foo","bar","soom")}\nfoobarsoom\n\n[13:21]dgpIs\sthis\snew\sability\san\sintended\nimprovement?\s\sOr\san\sunintended\simplementation\sconsquence?\n[13:21]dkf_dgp:\simprovement\s\n[13:22]dkf_I\sdon't\sknow\sabout\s"intended"\sthough\n[13:22]dgpdon't\sjudge\stoo\squickly...\s\n\n[13:23]dkf_What\sI\scan\ssay\sis\sthat\sI\sknow\show\sbad\sit\nwas\sbefore,\shaving\stried\sto\swrite\snew\sfunctions\susing\nthat\sold\sAPI\n[13:23]dgp%\sexpr\s{append("N","a","N")}\ndomain\serror:\sargument\snot\sin\svalid\srange\n\n[13:24]dgpif\sthe\s[expr]\score\sis\ssupposed\sto\scheck\sfor\nnumeric-ness\sof\sthe\sresult\sof\sa\sfunction,\sthen\nscreening\sout\sNaN's\smight\smake\ssense.\n[13:24]dgpbut\sif\swe\sintend\sstring\sfunctions\sto\swork,\nwe\sneed\sto\sstop\sdoing\sthat.\n[13:25]dkf_Earlier\son,\sI\ssaid\sthat\sNaN\swas\s"the\nscreaming\shorror\shiding\sin\sthe\sspace\sbetween\sthe\s1s\sand\nthe\s0s"\sand\sI\smeant\sit\n\n[13:26]spjuthTry:\sexpr\s{append("0","x","AF")}\n[13:26]dgpsame\sinterp:\n%\sexpr\s{sqrt(-1)}\nNaN(7ffffffffffff)\n[13:26]dgpso\seither\sway,\sthe\sHEAD\sis\scurrently\nbuggy/inconsistent\n[13:26]dkf_it's\sthe\scvtToNumeric\sopcode\sthat's\swacky\n[13:26]dgpbut\sI'd\slike\sto\sknow\smy\sopinions\sabout\nwhich\sway\scorrectness\slies\saren't\sin\sgross\sconflict\nwith\sothers.\n[13:27]dgp%\sexpr\s{append("0","x","AF")}\s\n175\n[13:30]dkf_What\swould\sfail\sif\sline\stclCompExpr.c:260\nwas\scommented\sout?\n[13:30]dgpI'll\stest\sand\sfind\sout...\n[13:30]dkf_since\sI\sthink\sthat's\swhat\sis\scausing\sthe\nproblem\n[13:32]dgpwhy\sis\sthat\sline\sinactive\sin\sthe\ssqrt()\nexample?\n[13:32]dkf_probably\sa\sbuggy\sINST_TRY_CVT_TO_NUMERIC\nimplementation\n\n[13:34]dgpdkf,\smucho\sfailures\sregarding\sstring\srep\sof\nnumbers\n[13:34]dgp[expr]\sapparently\sis\ssupposed\sto\sproduce\ncanonical\sstring\sreps\n[13:35]dgp%\sexpr\s0x1\s\s\n1\n\nspjuthMight\sbe\sthat\ssqrt(-1)\scontains\sa\sunary\sminus\noperator,\sthus\sINST_TRY_\sis\sskipped.
J foundin obsolete:\s8.5a5
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 47.\sBytecode\sCompiler
J title mathfuncs\sreturn\sstrings?\snumbers?
J type Bug
K 1489011fffffffffffffffffffffffffffffffff
U dgp
Z 4abb7e7b2e8ba19e76ae816b7ab790ee