Skip to content
Tcl Source Code Artifact [ec9578399d]
Login

Artifact [ec9578399d]

Artifact ec9578399d77d3e37b32092fb5891b64b94157e573be9f7c65c33709bcc6cf75:

Ticket change [ec9578399d] - Ticket [b5bd08df8d61b4ea|b5bd08df8d] <i>The &quot;int&quot; type registration should be restored.</i> status still Open with 3 other changes by sebres on 2024-06-24 18:02:42.
D 2024-06-24T18:02:42.524
J icomment The\schecks\sfor\sint-type\shave\smostly\snothing\sto\sdo\swith\sshimmering,\svice\sversa\ssometimes\sit\shelps\sto\savoid\sshimmering,\se.\sg.\sif\sobject\sis\snot\sint\stry\sindex\sor\soption\s(compare\sstring)\sor\swhatever\stype...\sIt\salso\smay\shelp\sto\savoid\sgeneration\sof\sstring\srepresentation,\setc.\r\n\r\nFor\severyone\swho\sused\stypes\sit\sis\sclear\sthat\sthe\sobject\smay\sbe\san\sinteger\sbut\shave\sdifferent\stype.\sWhat\sdidn't\sexclude\ssimple\soptimizations\sin\scase\sit\sis\salready\san\sint-type.\r\n\r\nThe\ssuggestion\sin\sTIP\sto\screate\sint-object\sto\sobtain\sa\stype\s(and\sremove\sit\shereafter)\sis\sdirty\sworkaround\sand\scannot\sbe\sreally\sconsidered\sas\snormal\ssolution,\sat\sleast\sfor\snormal\sknown\stypes\s(especially\sif\sthey\swere\salready\sthere\spreviously).\r\n\r\nAlso\ssuggested\sby\sJan\s`Tcl_GetNumberFromObj`\sis\snot\sreally\san\salternative\s-\swhy\sif\sone\sneeds\sto\sconsider\sint-type\sonly\s(for\swhatever\sreason),\sone\shas\sto\suse\sfunction\swhich\salso\schecks\sdoubles,\sbignums,\setc...\slet\salone,\sthe\sbranch\smispredictions...\seven\sin\sideal\scases,\snot\sto\smention\sup\sto\s9\sjumps\sin\sworse\scase,\sfor\sinstance,\sif\sit\sis\snot\san\sinteger\sand\sthe\scheck\swas\spreviously\ssimple\s(not\sint,\sthen\stry\sindex\sor\scompare\sstring).\r\n\r\nI'll\stry\sto\ssummarize\sthe\sarguments\sfor\stype-registration:\r\n-\sperformance\s-\ssimplest\sway\sever\sto\scheck\swhether\sthe\sargument\sis\s**already**\san\sint,\sso\smay\sbe\sused\sfor...\r\n-\sshimmer\savoidance\s(if\sobjv[i]\smay\sbe\san\sint\sand\ssome\sother\stype),\sor...\r\n-\spreventing\sthe\sgeneration\sof\sstring\srepresentations\s(it'd\sremain\spure\sint)\r\n-\scheck\swhether\sobject\sis\splain\r\n-\setc.\r\n\r\nThe\sTcl\ssource\scode\sitself\sis\sfull\swith\s`TclHasInternalRep(...,\s&tclIntType)`,\sso\swhy\sthe\sextensions\smay\snot\sneed\sthat\s(or\sshall\suse\sweird\sworkarounds).\r\n\r\nPlease\sstop\sthink\sfor\sthe\sdevs\show\sit\sis\sbetter\sfor\sthem\sto\sdo\ssomething.\sMany\speople\sknows\sit\salready,\sand\sfor\sothers\sone\scan\simprove\sthe\sdocumentation\sor\sexplain\sthe\sshimmering\sor\swhatever\sconsequences\sinstead.
J login sebres
J mimetype text/x-markdown
K b5bd08df8d61b4ea9bf0cc885f790b367c430a9f
U sebres
Z 17bcce9001303257f51f0cf4116ed64a