Skip to content
Tcl Source Code Artifact [e44267c64a]
Login

Artifact [e44267c64a]

Artifact e44267c64ac531cc0cc5b0a49f441dd086e8f62a:

Ticket change [e44267c64a] - Ticket [3057639fffffffff|3057639fff] <i>lappend inconsistency with respect to read traces</i> status still Open with 4 other changes by andreas_kupries on 2010-09-02 00:51:09.
D 2010-09-02T00:51:09
J icomment Continued\snotes\s...\n===============\n\n[HL]\sNote\sthat\sYYYY\sis\sZZZZ\sand\swe\scan\sprobably\sfix/make\schanges\sto\sit\sto\sget\sit\sto\swork\sif\snecessary.\sBut\swe\sare\smore\sconcerned\sabout\suser\sscripts\scompatibility\sand\show\swill\sthey\sbe\saffected\s--\swe\shave\sno\sway\sof\smodifying\suser\sscripts\sif\sthey\srun\sinto\sthis\ssituation.\sSo\swe\swould\slike\sto\sget\sto\sthe\sbottom\sof\sthe\sissue\s--\sprimarily\swhat\sis\sthe\sintended\sbehavior\swhen\sread\straces\sare\sset\son\snon-existent\svariables\sand\show\slappend\soperates\son\sit.\s\n\n===============\n\n[JH]\sIn\sthe\s2\sswitch\scases\sbelow,\syou\sare\sseeing\sthe\ssubtle\svariation\sbetween\sa\sswitch\sthat\scan\sbe\sbytecompiled\s(with\s--)\sand\swithout\s(because\s$oper\smay\sbe\sanother\soption\sto\sswitch,\sit\schecks\sat\sruntime\sinstead\sof\sbytecompiling).\n\nAs\sto\sother\svariables,\sthis\sdoes\shave\sthe\ssame\sbehavior,\sif\syou\sfollow\sthe\ssame\strace\sproc\sthat\s::env\shas\sset\sby\sdefault:\n\nproc\stest\s{oper\svar\selem\svalue}\s\s{\n\s\s\s\supvar\s#0\s$var\slvar\n\s\s\s\sswitch\s--\s$oper\s{\sadd\s{\slappend\slvar($elem)\s$value\s}\s}\n}\nproc\snonull\s{var\skey\sval}\s{\n\s\s\s\supvar\s1\s$var\slvar\n\s\s\s\sif\s{![info\sexists\slvar($key)]}\s{\sreturn\s-code\serror\s"no\ssuch\svariable"\s}\n}\ntrace\sadd\svariable\smyvar\sread\snonull\ntest\sadd\smyvar\skey\s"new\svalue"\n\nThe\s'nonull'\sstyle\sof\strace\sis\swhat\s::env\shas\shad\sset\sfor\sa\slong\stime.\s\sThe\sdifference\sis\sthat\sbyte-coded\slappend\schanged\sto\sdo\sread\straces.\s\sThis\swas\sdone\sin\s8.4,\sbut\sdone\sincompletely\ssuch\sthat\sonly\s_bytecompiled_\slappend\swas\saffected.\s\sThus,\syou\swould\shave\sencountered\sthis\sin\s8.4\salready\shad\syou\swritten\sthe\sautoeasy\scode\sslightly\sdifferently.\n\nThe\sanswer\smay\sbe\sto\sremove\sthese\sread\straces\son\svariables,\sbut\sdo\swe\sdo\sthat\sfor\s8.4\sand\s8.5,\sor\sjust\s8.5+?\s\sOr\sjust\sfor\sarrays,\sand\sleave\sfor\sscalars?\s\sThat\swould\sbe\svery\sodd.\s\sI\sthink\sthat\smight\sbe\sthe\sbest\sway\sto\sgo,\sbecause\sotherwise\slappend\sis\ssimply\sa\strap\sthat\scannot\sbe\sused\sfor\scurrently\sempty\s::env\svars.\s\sThe\squestion\sthat\sneeds\sto\sbe\sfirst\sanswered\sis\swhat\sother\simpact\sthis\smight\shave\sfor\sthose\sthat\sexpected\sto\shave\sthe\sread\straces\sexecuted.\n\nWhat\sdo\syou\sthink\sof\sthat?\n\n===============\n\n[HL]\sIs\snonull\strace\sonly\sset\sfor\senv\svariable\sor\sfor\sother\svariables\stoo?\sIf\sthis\sbehavior\sis\schanged,\ssomeone\selse\sout\sthere\smight\sbe\srelying\son\sthis\sfeature\s--\swill\svery\sdifficult\sto\sfind\sout.\n\nThe\sother\squestion\sis:\sshould\slappend\sbe\sconsidered\sto\shave\sa\sread\strace.\sHow\sdo\sappend,\slset\sor\sany\sother\scommand\swhich\smodifies\sexisting\svariable\sbehave.\sDo\sthey\sinvoke\sread\straces\swhenever\sthe\svariable\svalue\sis\supdated\sor\sdo\sthey\salso\sdepend\son\swhether\sit\sis\sbyte-compiled\sor\snot.\n\nI\sthink\sthat\sthe\sread-traces\sshould\sbe\sconsistent\sin\swhether\sthey\sare\sinvoked\sor\snot\sfor\sall\sscenarios\sand\snot\sbe\sdependent\son\sbyte-compiled\sor\snot.\sOtherwise\swe\swould\sbe\swaiting\sfor\sanother\sbug/fix\scycle\sneeded\sin\sthe\sfuture.\n\nHaving\ssaid\sall\sthis,\s[...],\sI\swould\slike\sit\sto\snot\sthrow\sany\serrors\son\supgrade\sso\sthat\sno\smodifications\sare\srequired\son\sour\send\sto\supgrade.\s\n\n===============\n\n[JH]\sThe\snonull\sbehavior\sis\sparticular\sto\sthe\s::env\sarray\sin\sTcl\sin\sthat\sit\sis\sthe\sdefault\sbehavior\son\sthat\sarray\sdefined\sby\sTcl.\s\sNo\sother\sarrays\shave\straces\son\sthem\sby\sdefault,\sbut\susers\scould\sset\sup\ssuch\sthemselves.\n\nOnly\slappend\shas\sthis\sread\strace\sbehavior\sturned\son\sat\sthe\sbytecode\slevel,\sappend\sdoes\snot.\s\sI'm\sbeginning\sto\sthink\sthis\sis\sjust\snot\sgood\sthat\slappend\sdoes\sthis\sread\strace\sin\sthis\sway.\s\sWhile\stechnically\scorrect,\sthe\sother\ssetter\sfunctions\sdon't\smirror\sthis\sbehavior,\sand\slappend\sis\sonly\sdoing\sit\swhen\sbyte-compiled,\snot\sotherwise.\n\nI'll\sprepare\sa\sbug\sreport\sfor\sthis,\sas\sit\swill\sbe\sgood\sto\shave\sit\sdocumented.\s\sI\swill\sprobably\shave\sthis\sbehavior\schanged\sin\sboth\s8.4\sand\s8.5\sbranches\sas\swell\sas\shead,\sso\sit\swill\sagain\sbe\sconsistent\sif\syou\sare\susing\sthe\slatest.\s\sAgain,\sbe\swarned\sthough\sthat\slappend\scan\scause\sthis\serror\sin\sthe\scurrent\s8.4\sif\syou\shave\sa\sfully\sbyte-compiled\scode\ssegment.\n\n
J login andreas_kupries
J mimetype text/plain
J username andreas_kupries
K 3057639fffffffffffffffffffffffffffffffff
U andreas_kupries
Z 08dee1a27193f57d45a4c70a3c17ce27