Skip to content
Tcl Source Code Artifact [dae29ad7af]
Login

Artifact [dae29ad7af]

Artifact dae29ad7af066240435b584a7f5cc64fc99bc0149fa3846313e54d65539f4fc9:

Ticket change [dae29ad7af] - New ticket [90657479e8f2a76c|90657479e8] <i>code review [2201fdb82c]</i>. by dkf on 2017-12-11 23:02:10.
D 2017-12-11T23:02:10.691
J assignee nobody
J closer nobody
J cmimetype text/html
J comment <ol>\r\n<li>What\sis\sthe\schange\sto\stclBasic.c\sdoing\sin\sthere?\r\n<li>The\sRemoveItem\smacro\sprobably\sought\sto\sbe\swritten\slike\sthis:\r\n<pre>\r\n#define\sRemoveItem(type,\slst,\si)\s\\\r\n\s\s\s\sdo\s{\s\\\r\n\tRemove\s##\stype\s((lst).list,\s(lst).num,\si);\s\\\r\n\t(lst).num--;\s\\\r\n\s\s\s\s}\swhile\s(0)\r\n</pre>\r\nIt's\sa\sstandard\stransform\sthat\sdefangs\sthe\sworst\sof\ssyntactic\sgames\sthat\sC\scan\sthrow\sat\syou.\r\n<li>The\schanges\sto\suse\sTclNRCreateCommandInNs\sinstead\sof\sdirectly\smaking\sthe\s<tt>my</tt>\scommand\s<i>must</i>\sbe\sperformance-profiled.\sIt's\sbecause\sof\sperformance\sprofiling\sthat\sthe\sweird\sdirect\smethod\swas\sused\sat\sall;\sthat\scode\sis\shot-path\sfor\sobject\sinstantiation\sand\swe\swant\sto\stry\sto\savoid\sslowing\sthat\sdown.\r\n<li>I\slike\sthat\sit\slooks\slike\ssome\ssimplifications\shave\sbeen\spossible\sin\sthe\sdeletion\scode.\sI\sreally\sreally\swish\sthat\sI\scould\sbe\scertain\sthat\sthey\swere\scorrect\sfrom\sjust\sinspection.\sThere's\sa\sgreat\smany\sways\san\sobject\scan\sget\sdeleted,\ssuch\sas\sby\sits\sdestroy\smethod,\sby\s<tt>rename</tt>,\sby\shaving\sits\snamespace\swiped\sout,\sby\shaving\sits\sinterpreter\sdestroyed,\sand\sby\shaving\sits\sclass\sor\smixins\sdestroyed.\sAnd\smaybe\sothers.\r\n<li>Re\sthe\scomment:\r\n<blockquote><tt>To\sdo:\sGet\sdkf\sto\sweigh\sin\son\swether\sthis\sshould\sbe\sprotected\swith\sa\s!IsRoot()\scondition.</tt></blockquote>\r\nthe\sissue\sis\sthat\soo::object\sand\soo::class\spoint\smutually\sat\seach\sother\s(and\sare\sthe\s<i>only</i>\spair\sof\sclasses\swhere\sthis\sis\slegal).\sCare\smust\sbe\staken\sto\sensure\sthat\sthe\sspecialness\sis\snot\sundone\sby\saccident\sand\sthe\susual\sconsequences\sof\strying\sprobably\sshould\sbe\seither\sa\s“computer\ssays\sno!”\sor\san\sorderly\sdelete\sof\sthe\swhole\sof\sTclOO.\r\n<li>The\schange\sto\stclOOBasic.c\sis\swrong;\sthe\sdestroy\smethod\sshould\sbe\sensuring\sthat\sno\sextra\sarguments\sare\spassed,\sas\sit\sis\sdocumented\sto\snot\stake\sextra\sargs.\r\n<li>I'm\snot\ssure\sabout\sthe\schanges\sto\sthe\sFOREACH\smacro;\sit\swas\sintended\sto\sbe\sa\ssimple\siterator\srather\sthan\sproviding\sthose\sextra\sskip-NULL-entry\scapabilities,\sso\sadding\sextra\schecking\ssuch\sas\syou\sdo\sruns\sthe\srisk\sof\sintroducing\shazards.\r\n</ol>
J foundin 2201fdb82c
J is_private 0
J login dkf
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J submitter dkf
J subsystem 35.\sTclOO\sPackage
J title code\sreview\s[2201fdb82c]
J type Bug
K 90657479e8f2a76c6603726c25c03a3582402ad8
U dkf
Z cc0a8e7a17a9245e117153b365355659