Artifacts Associated With Ticket 1274916fffffffff
Ticket change [071f25f6b1] (rid 89333) by msofer on 2005-08-28 01:34:22:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The behaviour of upvar otherVar myVar is wrong when myVar is a qualified name, as it does not follow Tcl's (insane?) variable resolution rules: it skips the global lookup upon failure of the local one. Witness: % set x 1 1 % namespace eval a {upvar x b::x} can't create "b::x": parent namespace doesn't exist % namespace eval b {} % namespace eval a {upvar x b::x} can't create "b::x": parent namespace doesn't exist % namespace eval b {variable x 2} % namespace eval a {upvar x b::x} can't create "b::x": parent namespace doesn't exist % namespace eval a {set b::x} 2 This worked as expected in Tcl8.3.4, and is broken as described above in 8.4.7 and HEAD. Breakage was probably introduced at some point in the 8.4 line (LOOKUP_FOR_UPVAR). - foundin initialized to: "None"
- priority initialized to: "8"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "07. Variables"
- title initialized to: "upvar and qualified varNames"
- type initialized to: "Bug"
Ticket change [15d65f22cb] (rid 124630) by msofer on 2005-08-28 08:51:53:
- icomment:
Logged In: YES user_id=148712 Note that this behaviour was introduced as a fix for Bug #696893. Avoiding the global lookup appears not to have been a correct reconstruction of Tcl8.3's lookup rules.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [a3411fa5a3] (rid 110022) by msofer on 2005-08-28 19:37:39:
- icomment:
Logged In: YES user_id=148712 The problem is that [upvar] has different rules for creative writing in the not-fully-qualified case. In the example above namespace eval a {upvar x b::x} the new variable should refer (in order) to: (1) ::a::b::x if the namespace ::a::b exists (2) ::b::x if the namespace ::b exists Note that this refers to the existence of namespaces; the usual resolution rules refer to the existence of the variables themselves, ie for [namespace eval a {set b::x 1}] the reference is to: (1) ::a::b::x if the variable ::a::b::x exists (2) ::b::x if the variable ::b::x exists (3) ::a::b::x otherwise (even if ::b exists but ::a::b does not) - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [1f926d9010] (rid 91168) by msofer on 2005-08-28 19:47:17:
- icomment:
Logged In: YES user_id=148712 The question now is if this behaviour in 8.3 is intended, or just an implementation side effect. Ths docs do not even mention the possibility of creating anything but a proc-local variable via upvar.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [43233eb3d4] (rid 116494) by msofer on 2009-05-01 08:21:38:
- priority changed to: "7 High"