Skip to content
Tcl Source Code Artifact [6469b56e58]
Login

Artifact [6469b56e58]

Artifact 6469b56e58893b4ff39a1b3421ba3a1a34e3da9a:

Ticket change [6469b56e58] - New ticket [1251123fffffffff|1251123fff] <i>Variable resolution behaviour and documentation</i>. by oox on 2005-08-03 15:51:49.
D 2005-08-03T15:51:49
J assignee msofer
J cmimetype text/plain
J comment Consider\sthe\sfollowing:\s\n\n(bin)\s1\s%\snamespace\seval\s::N\s{set\sbar\s2}\s\n2\s\n(bin)\s2\s%\sputs\s$bar\s\ncan't\sread\s"bar":\sno\ssuch\svariable\s\n(bin)\s3\s%\sputs\s$::N::bar\s\n2\s\n(bin)\s4\s%\sset\sfoo\s1\s\n1\s\n(bin)\s5\s%\sputs\s$foo\s\n1\s\n(bin)\s6\s%\snamespace\seval\s::N\s{set\sfoo\s2}\s\n2\s\n(bin)\s7\s%\sputs\s$foo\s\n2\s\n(bin)\s8\s%\sputs\s$::N::foo\s\ncan't\sread\s"::N::foo":\sno\ssuch\svariable\s\n\nI\swould\sexpect\sline\s6\sto\screate\s::N::foo,\sin\sthe\ssame\sway\s\nthat\sline\s1\screated\s::N::bar,\sbut\sTcl\snotices\sthat\s::foo\s\nexists,\sand\ssomehow\sresolves\sto\sit.\sThe\sNAME\s\nRESOLUTION\ssection\sof\sthe\s[namespace]\smanual\spage\s\nsays\sthat\sfor\sunqualified\snames\sthe\sfollowing\s\napplies:\s"Command\sand\svariable\snames\sare\salways\s\nresolved\sby\slooking\sfirst\sin\sthe\scurrent\snamespace,\sand\s\nthen\sin\sthe\sglobal\snamespace".\sThis\sapplies\s'correctly'\s\nto\svariable\s*access*,\sbut\sin\sa\sfunny\sway\sto\svariable\s\n*creation*.\s\n\nWhat\sis\sworse,\scommand\screation\sbehaves\sdifferently:\s\ninvoking\s[proc]\swith\san\sunqualified\sprocedure\sname\s\nwithin\sa\snamespace\screates\sthe\sprocedure\sin\sthat\s\nnamespace\sirrespectively\son\swhether\sor\snot\san\sequally\s\nnamed\sprocedure\salready\sexists\sin\sthe\sglobal\s\nnamespace.\s\n\nI\sunderstand\sthat\smodyifing\svariable\sresolution\srules\sis\s\nsomething\sto\sbe\savoided.\sWhat\sI\spropose\sis\sadding\sa\s\nsentence\sto\sthe\sNAME\sRESOLUTION\ssection\sof\sthe\s\n[namespace]\smanual\spage\sabove\sdescribing\sthis\s\nobserved\sbehaviour.
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter oox
J subsystem 21.\s[namespace]
J title Variable\sresolution\sbehaviour\sand\sdocumentation
J type Bug
K 1251123fffffffffffffffffffffffffffffffff
U oox
Z 72f561bb283e97a23f8341b2c7c78b6b