.
D 2004-05-25T09:12:10
J icomment Logged\sIn:\sYES\s\nuser_id=148712\n\nThis\swas\sindeed\sbroken\sby\sthe\sfix\sto\sBug\s#959052.\sThere\sare\nseveral\spossible\sfixes,\sthey\sare\sthe\ssubject\sof\sthe\snext\spost.\n\nThe\scode\sabove\sis\svery\snon-standard,\sand\sdoes\snot\swork\squite\nas\s(I\sguess\sthat)\sthe\sauthor\sintended\sin\stcl8.x\s(due\sto\sthe\ndocumentation\sbug\s#959831).\n\nWhat\shappens\sin\sthat\scode\sis:\n\n(1)\s'global'\senters\s"name"\sin\sthe\svariable\shash-table\sfor\nfoo,\sand\screates\sa\slocal\svariable\scalled\s"name"\slinked\sto\nit.\s::foo::name\sis\sundefined,\sand\s\n'info\svars\s::foo::name'\sreturns\s{}\n\n(2)\swhen\s'set\sfoo::name\s1'\sis\scalled,\sthe\svariable\sname\nresolution\sproceeds\sas\sfollows:\n\s\s\s\s-\s"name"\sis\slooked\sup\sin\sthe\s::foo::foo\snamespace;\snot\sfound\n\s\s\s\s-\s"name"\sis\slooked\sup\sin\sthe\s::foo\snamespace;\sfound\s(by\nbug\s#959052)\n\nThat\scode\sworks\s"by\schance":\n\n\s\s%\sinfo\spatch\n\s\s8.3.4\n\s\s%\s\snamespace\seval\sfoo\s{}\n\s\s%\snamespace\seval\sfoo::foo\s{set\sname\s2}\n\s\s2\n\s\s%\sproc\sfoo::bar\s{}\s{\n\s\s\s\s\s\s\s\s\s\sglobal\sfoo::name\n\s\s\s\s\s\s\s\s\s\sset\sfoo::name\s1\n\s\s\s\s\s\s}\n\s\s%\s\sfoo::bar\n\s\s1\n\s\s%\sset\sfoo::name\n\s\scan't\sread\s"foo::name":\sno\ssuch\svariable\n\s\s%\s\sset\sfoo::foo::name\n\s\s1\n\nIn\stcl8.x\sthe\scorrect\soptions\swould\sbe:\n\n\s\s\s\svariable\sname\n\s\s\s\sset\sname\s1\n\s\n\s\s\s\s\sglobal\sfoo::name\n\s\s\s\s\sset\sname\s1\n\n\s\s\s\s\sset\s::foo::name\s1\n\nThe\sfirst\stwo\sare\sthe\sbest\sones,\sand\soffer\sthe\sbest\nperformance\s(variable\saccess\sabout\s5x\sfaster\sthan\sthe\noriginal);\sI\ssuppose\sthat\sthe\ssecond\sone\sis\sbackwards\ncompatible\sto\stcl7.x,\sbut\sam\snot\ssure.\sThe\sthird\soption\sis\ndefinitely\sbackwards\scompatible\sto\stcl7.x,\sbut\sslower\sin\ntcl8.x\s(about\sas\sfast\sas\sthe\soriginal\sin\sgeneral,\s3x\sfaster\nin\stcl8.5a2).\n
J login msofer
J mimetype text/plain
J username msofer
K 959786ffffffffffffffffffffffffffffffffff
U msofer
Z 6c7ee59b2b54ad21080d3d2ce9e1f73e