Skip to content
Tcl Source Code Artifact [803b1e8f2c]
Login

Artifact [803b1e8f2c]

Artifact 803b1e8f2c6caded8561f3c25d2842fddc2cf8ae:

Ticket change [803b1e8f2c] - Ticket [2929546fffffffff|2929546fff] <i>&quot;dict with&quot; binds to varibles outside its scope</i> status still Open with 4 other changes by johannes-kuhn on 2010-01-11 23:04:43.
D 2010-01-11T23:04:43
J icomment dict\swith\sworks\sas\sfollows:\nit\ssets\sfor\seach\skey\sa\svariable\swith\sthe\sname\sof\sthe\skey\sand\sthe\svalue\sin\sthe\ssame\sscope,\sand\ssafes\sa\slist\sof\svariables\sthat\sexist\sat\sthis\spoint.\nAfter\sexecution\sof\sthe\sbody\sit\swrites\sall\schanged\svariables\sthat\scorrespond\sto\sa\skey\sand\snew\svariables\sback\sto\sthe\sdict.\n\nA\sside-effect\sof\sthis\sis\sthat\sall\svariables\swith\sa\scorresponding\skey\sare\soverwritten.\ne.g\n%\sset\sa\sA\n%\sdict\sset\sx\sa\s1\n%\sdict\swith\sx\s{}\n%\sset\sa\nwould\sreturn\s1\n\nThis\saffects\sall\sVersions\sof\sTcl\s8.5\sand\sTcl\s8.6\sand\sis\sdocumented.\n\nOther\sexample:\nset\sb(1)\s2\ndict\sset\sx\sb\s3\ndict\swith\sx\s{}\n->\scan't\sset\s"b":\svariable\sis\sarray\n\nImho\sthis\sisn't\sa\sbug.\sIt's\sa\sfeature.\n\nTip:\suse\sapply\sand\supvar\sto\savoid\sthis.\n
J login johannes-kuhn
J mimetype text/plain
J username johannes-kuhn
K 2929546fffffffffffffffffffffffffffffffff
U johannes-kuhn
Z f32f5b772aafecde7a7b9f33f80e7d2c