<i>[namespace which -var] fails for ary(i)</i> status still Open with 7 other changes
by
.
D 2017-05-15T11:46:42.563
J closer nobody
J comment [namespace\swhich\s-variable\sary(i)]\sreturns\sa\snull\s\r\nstring\seven\swhen\sary(i)\sexists!\sThis\sis\sa\smajor\spain\r\nwhen\strying\sto\sget\sfully\sscoped\svariable\snames\sto\sgive\s\r\nto\swidgets.\sHere\sis\sa\sscript\ssnippet\sthat\sshows\sthe\s\r\neror:
J icomment Miquel\sSofer\swrote:\r\n<verbatim>\r\n(2)\sIt's\snot\sso\sclear\sto\sme\swhat\sthe\scorrect\sfix\swould\sbe:\r\nwhat\sshould\shappen\sif\sthe\sarray\sitself\sexists,\sbut\sthe\sarray\r\nelement\sdoes\snot?\sIn\syour\sscript,\swhat\sis\sthe\sexpected\r\nresult\sof\sadding\sa\sline\r\n\s\s\sputs\s"4\s-\s[namespace\swhich\s-variable\sary(k)]"\r\nAccording\sto\sthe\sman\spage,\sthe\sreturn\sshould\sbe\s""\s-\sis\sthis\r\nwhat\syou're\sexpecting?\r\n</verbatim>\r\n\r\nLet\sme\sexpress\smy\sexpectation.\r\n<b>[namespace\swhich\s-variable\sary(k)]</b>\sshould\sdo\sthe\sfollowing:\r\n\s\s\s*\s\s\sresolve\s"ary"\sin\sthe\slocal\sscope\r\n\s\s\s*\s\s\scheck\sif\sit\sis\san\sarray.\sIf\snot\s->\serror\r\n\s\s\s*\s\s\sformat\sthe\sresult\sthe\ssame\sway\sas\s<b>[namespace\swhich\s-variable\sary](k)</b>.\sThis\smeans,\sthat\sthe\sexistence\sof\sthe\sgiven\sarray\sindex\smust\snot\sexist\sand\sis\snot\srelevant.\sThe\sexistance\sof\sthe\sarray\sand\sits\sscope\sis\simportant.
J login oehhar
J mimetype text/x-fossil-wiki
J severity Minor
J username oehhar
K 472113ffffffffffffffffffffffffffffffffff
U oehhar
Z 347f419b95068e0d17e6c93287571493