From: SourceForge.net <no...@so...> - 2010-01-11 00:54:41
|
Bugs item #2929546, was opened at 2010-01-10 16:54 Message generated for change (Tracker Item Submitted) made by mpdanielson You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2929546&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 15. Dict Object Group: development: 8.6b1.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Paul Danielson (mpdanielson) Assigned to: Donal K. Fellows (dkf) Summary: "dict with" binds to varibles outside its scope Initial Comment: Setting a variable inside a "dict with" body changes the value of the dictionary and also changes the value of a variable with the same name outside of the body. In the following sequence, the value of ::a is changed when the value of the entry named "a" in the dictionary "x" is changed. I expected that only the dictionary would be changed. (paul) 101 % set tcl_patchLevel 8.6b1.1 (paul) 102 % set a A A (paul) 103 % dict set x a 1 a 1 (paul) 104 % set a A (paul) 105 % set x a 1 (paul) 106 % dict with x { set a } 1 (paul) 107 % dict with x { set a 2 } 2 (paul) 108 % set a 2 (paul) 109 % set x a 2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2929546&group_id=10894 |