Artifacts Associated With Ticket 604226ffffffffff
Ticket change [ae138cf721] (rid 101574) by dgp on 2002-09-03 22:31:37:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% namespace eval a variable x % namespace eval b variable ::a::x % set a::x 1 1 % info exists b::x 0
- foundin initialized to: "obsolete: 8.4.0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "07. Variables"
- title initialized to: "[variable] link to non-existent var"
- type initialized to: "RFE"
Ticket change [d4a9836dd2] (rid 123489) by dgp on 2002-09-04 06:03:54:
- icomment:
Logged In: YES user_id=80530 If this is not a bug, it's definitely a place to clarify the docs. Related behavior: % namespace eval a variable x 1 % namespace eval b variable ::a::x % puts $b::x can't read "b::x": no such variable % namespace eval b { variable ::a::x puts $x } can't read "x": no such variable % proc b::foo {} { variable ::a::x puts $x } % b::foo 1 Different behavior of [variable] within a proc compared to within a [namespace eval] needs either correction or more explicit documentation. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [dcf13d9214] (rid 114573) by msofer on 2004-03-28 07:20:57:
- assignee changed to: "dgp"
- icomment:
Logged In: YES user_id=148712 Don: care to re-read variable.n? That is actually the documented behaviour, except that the docs are not too explicit about what happens with varnames with :: within procs ... The problem is: you (and I, and maybe everybody else ...) expect 'variable' to create a local linked variable even when not in a proc. But that is not what is promised, ie: it is not true that variable ::a::x is equivalent to upvar 0 ::a::x x Apparently 'variable' was born to correct for the weird lookup rules we have? So: what do we do? RFE/TIP? Leave as is?
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- username: "msofer"
Ticket change [b142fdb6a8] (rid 98120) by dgp on 2004-03-29 23:10:49:
- icomment:
Logged In: YES user_id=80530 I tend to think this is a mis-feature. I accept I may be missing something important, yet subtle. I'd like to see a TIP propsing the addition of setting up namespace -> namespace variable links by [variable] when not within a proc. If in fact, that is a bad idea, then some of the examples in this report could be incorporated into variable.n to more explicitly demonstrate the difference.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [6c57049cb8] (rid 128487) by dgp on 2004-03-29 23:11:21:
- assignee changed to: "msofer"
Ticket change [3869f132e7] (rid 112205) by msofer on 2004-03-29 23:29:20:
- foundin changed to: "None"
- resolution changed to: "None"
- subsystem changed to: "None"
Ticket change [c0cdf80b8a] (rid 102476) by msofer on 2004-03-29 23:29:21:
- assignee changed to: "nobody"
- icomment:
Logged In: YES user_id=148712 Reclassifying then as RFE. The request is that, whenever [variable] addresses a namespace variable in a different namespace, it also creates a local link. In code, that whenever $name is a qualified variable name, variable $name $val be equivalent to set lname [namespace tail $name] upvar 0 $name $lname set $lname $val This would require a TIP.
- login: "msofer"
- mimetype: "text/plain"
- title changed to: "[variable] should always create a link"
- username: "msofer"
Ticket change [662a652196] (rid 102656) by dkf on 2004-03-30 15:30:44:
- assignee changed to: "msofer"
- subsystem changed to: "07. Variables"
Ticket change [0178ce22a5] (rid 119489) by msofer on 2006-09-30 00:46:41:
- priority changed to: "8"
Ticket change [d6949d8c04] (rid 123829) by msofer on 2006-10-03 05:56:53:
- icomment:
Logged In: YES user_id=148712 Uh ... not nice, [variable] is not even really a noop: % namespace eval a variable x % namespace eval b variable ::a::x 1 % set a::x 1 % set b::x can't read "b::x": no such variable
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [5c959e450c] (rid 115333) by msofer on 2006-10-31 02:36:43:
- closedate changed to: "2006-10-30T19:36:43"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 We isunderstood the purpose and/or docs of [variable]. Looking at namespace-old.test, I see that the usage there (and, from the comments, possibly an idiom in itcl) really requires the current behaviour outside of proc bodies. Consider test namespace-old.6.16 - to reduce headaches, notice that - there are no linked variables there - $trigger has been last defined in test 6.12, and is {set test_ns_cache_var} - $trigger2 has been last defined in test 6.15 and is {set test_ns_cache2::test_ns_cache_var} The test body is variable test_ns_cache1::test_ns_cache2::test_ns_cache_var "blah" list [namespace eval test_ns_cache1 $trigger2] \ [namespace eval test_ns_cache1::test_ns_cache2 $trigger] Here [variable] is being used to set the value of the variable ::test_ns_cache1::test_ns_cache2::test_ns_cache_var from the global space, but without a fully qualified name (why?). If a variable ::test_ns_cache_var were created to point to it, all manner of nastyness could ensue: a new GLOBAL variable that may break whatever code relies on the second lookup path, and wasted resources as the programmer never expected that new variable to be created. In order to link variables, use [upvar] or [namespace upvar]. - login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Rejected"
- status changed to: "Pending"
- username: "msofer"
Ticket change [f7c1019e2f] (rid 91424) by sf-robot on 2006-11-14 10:20:11:
- closedate changed to: "2006-11-14T03:20:11"
- closer changed to: "sf-robot"
- icomment:
Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"