Skip to content
Tcl Source Code Artifact [c549d8dfcf]
Login

Artifact [c549d8dfcf]

Artifact c549d8dfcf27f77b81e200fdb0a553225c03b489:

Ticket change [c549d8dfcf] - New ticket [218607ffffffffff|218607ffff] <i>array trace doesn&#39;t fire when an element is aliased with upv</i>. by nobody on 2000-10-26 01:03:02.
D 2000-10-26T01:03:02
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1433\sBug\nVersion:\s8.0.4\nSubmitDate:\s'1999-03-04'\nLastModified:\s'2000-01-20'\nSeverity:\sMED\nStatus:\sReleased\nSubmitter:\spat\nChangedBy:\sericm\nRelatedBugIDs:\s3917\nOS:\sAll\nFixedDate:\s'2000-01-20'\nFixedInVersion:\s8.3\nClosedDate:\s'2000-01-20'\n\n\nName:\nKevin\sB.\sKenny\n\nExtensions:\nNone\srelevant\n\nCustomShell:\nNo\srelevant\smodifications\n\nReproducibleScript:\n#\sWhen\sa\sprocedure\supvar's\san\sarray\selement\sto\sa\sscalar\svariable,\sand\n#\sthen\sset's\sthe\sscalar\svariable,\swrite\straces\son\sthe\sarray\sdo\snot\sfire.\n#\sThis\sallows\sthe\sarray\sto\schange\s"behind\sthe\sback"\sof\sthe\strace.\n\n#\sThe\sfollowing\sscript\sexhibits\sthe\sproblem:\n\nproc\scallback1\s{\sn1\sn2\sop\s}\s{\n\s\s\s\svariable\scallback1_data\n\s\s\s\sset\scallback1_data\s[list\s$n1\s$n2\s$op]\n\s\s\s\sreturn\n}\n\nproc\scallback2\s{\sn1\sn2\sop\s}\s{\n\s\s\s\svariable\scallback2_data\n\s\s\s\sset\scallback2_data\s[list\s$n1\s$n2\s$op]\n\s\s\s\sreturn\n}\n\nproc\sset_by_alias\s{\sname\svalue\s}\s{\n\s\s\s\supvar\s1\s$name\svariable\n\s\s\s\sset\svariable\s$value\n}\n\nset\sdata(test)\s{}\nset\scallback1_data\s{}\nset\scallback2_data\s{}\ntrace\svariable\sdata\sw\scallback1\ntrace\svariable\sdata(test)\sw\scallback2\n\nset_by_alias\sdata(test)\stest\n\nputs\s[list\s$callback1_data\s$callback2_data]\n\n\n\n\nObservedBehavior:\nThe\sarray\strace\sdoes\snot\sfire.\s\sThe\scallback1\sprocedure\sis\snever\sinvoked,\nand\scallback1_data\scontinues\sto\scontain\sthe\snull\sstring.\n\nThe\sscript\stherefore\sprints\n\n{}\s{variable\s{}\sw}\n\n\n\nDesiredBehavior:\nThis\sis\srather\sa\speculiar\scase.\s\sSince\sthe\s'data'\sarray\sis\snot\spresent\nin\sthe\scalling\snamespace\s*as\san\sarray*,\sbut\sonly\svia\sthe\salias,\sthe\strace\nprocedure\scan't\sget\sa\sname2\sargument.\s\sIt\smight\smake\ssense\sto\scall\sit\nwith\sname1\sequal\sto\sthe\supvar-alias\sand\sname2\sequal\sto\sthe\snull\sstring,\swhich\nwould\sat\sleast\slet\sit\sfind\sthe\scontent.\s\sUnfortunately,\sthis\ssolution\ngives\sthe\strace\sprocedure\sno\sway\sto\sdetermine\swhich\sarray\selement\sis\sbeing\sset!\n\nAn\salternative\smight\sbe\sto\scall\sthe\strace\sprocedure\suplevel'ed\sinto\sthe\nscope\sin\swhich\sthe\sarray\sis\sdefined.\s\sIn\sthis\scase,\sname1\sand\sname2\scould\nbe\sthe\soriginal\sarray\sname\sand\ssubscript.\s\sIn\saddition\sto\sa\sbunch\sof\schanges\nin\sthe\strace\slogic,\sthis\salternative\swould\srequire\ssome\schanges\sin\sthe\nVar\sstructure\sin\stclInt.h,\sso\sthat\san\sarray\selement\scan\sfind\sits\sarray\nand\san\supvar\salias\scan\sfind\sthe\sdefining\sstack\sframe.\n\nA\sthird\salternative\swould\sbe\sjust\sto\sdocument\sthe\sexisting\sbehavior,\sand\nwarn\sthat\sarray\straces\swill\snot\swork\sin\sthis\scase.\s\sIn\sthe\sprogram\sthat\sI\nwas\sworking\swith,\sthis\salternative\swould\sbe\sacceptable,\ssince\sI\swas\sable\nto\sreplace\sthe\strace\son\sthe\sarray\swith\straces\son\sthe\srelevant\selements\swithout\nany\sreal\strouble.\n\n\nThis\sproblem\sappears\sto\saffect\sall\sextant\sversions\sof\sTcl\sfrom\sthe\n8.0\sgeneral\srelease\sthrough\sthe\slatest\s8.1\ssources.\n\nWhen\sthe\sdevelopers\sdecide\swhat\sto\sdo\sabout\sthis,\sI'd\sappreciate\sa\snote\nvia\se-mail.\s\sThe\schosen\ssolution\saffects\ssome\sdocumentation\sthat\sI'm\swriting.\n\n\n\nThis\sis\sactually\sthe\sdesigned\sbehavior.\s\sThe\sproblem\sis\sthat\sas\sfurther\slevels\sof\sindirection\s(more\supvars)\sand\smore\straces\sare\sadded,\sit\sbecomes\sless\sand\sless\sclear\swhat\sthe\sbehavior\sshould\sbe;\sin\sorder\sto\savoid\sthat\s"slippery\sslope",\sthe\sbehavior\swas\sdefined\sthis\sway.\s\sConsider:\n\nproc\supdate\s{name\sind\sop}\s{\n\s\s\s\s\s\s\s\sputs\s"name\s$name\sindex\s$index"\n}\n\nproc\sgetUpdate\s{inVar}\s{\n\s\s\s\s\s\s\s\supvar\s$inVar\slocalVar\n\s\s\s\s\s\s\s\strace\svariable\slocalVar\sw\supdate\n\s\s\s\s\s\s\s\sgetUpdate2\slocalVar\n}\n\nproc\sgetUpdate2\s{inVar}\s{\n\s\s\s\s\s\s\s\supvar\s$inVar\slocalVar2\n\s\s\s\s\s\s\s\sset\slocalVar2\s100\n}\n\nset\ssomevar(1)\stest\ntrace\svariable\ssomevar\sw\supdate\ngetUpdate\ssomevar(1)\n\nIn\sthis\scase,\sone\scould\spersuasively\smake\sarguments\sfor\smany\sdifferent\sideas\sof\swhat\sthe\sbehavior\sshould\sbe.\s\sIt\scould\sfire\sboth\straces\swith\sthe\sname\ssomevar\sand\sthe\sindex\s1;\sit\scould\sfire\sone\strace\swith\sthe\sname\ssomevar\sand\sthe\sindex\s1\sand\sthe\sother\swith\sthe\sname\slocalVar\sand\sno\sindex;\sit\scould\sfire\sboth\straces\swith\sthe\sname\slocalVar2;\sit\scould\sfire\sneither\strace.\s\sI'm\ssure\sthere\sare\sother\spossibilities.\n\nOf\sthe\schoices,\sone\sstands\sout\sas\sbeing\sthe\seasiest\sto\simplement\sand\sthe\sleast\sconfusing:\s\sfire\sboth\straces\swith\sthe\sname\slocalVar2.\s\sI\sconsider\sthis\sthe\sleast\sconfusing\sbecause\sall\sof\sthe\svariables\srefer\sto\sthe\ssame\sobject,\sand\sthe\strace\sis\son\sthat\sobject,\sso\schanging\sthe\sobject's\svalue\sshould\sfire\sall\sthe\straces.\s\sAnd\scalling\sone\strace\swith\sone\sname\sand\sanother\strace\swith\sanother\sname\swhen\ssetting\sthe\ssame\sobject\swould\sbe\sconfusing.\s\sThus\sthe\sbehaviour\sis\sdefined\sas\sit\sis.\s\sThis\sis\snow\smore\sclearly\sdocumented\sin\sthe\supvar\sman\spage\sin\s8.3.\n\n-\seric\n\n--\s01/20/2000\sericm\n\n
J foundin obsolete:\s8.0.4
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 07.\sVariables
J title array\strace\sdoesn't\sfire\swhen\san\selement\sis\saliased\swith\supv
J type Bug
K 218607ffffffffffffffffffffffffffffffffff
U nobody
Z 0cfff040e62ae1fdfdb42e49f06a32b8