Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-11-10
06:09 • Closed ticket [480176ffff]: global :v makes wrong link plus 8 other change... artifact: 7b6d44e521 user: dgp
04:01 • Ticket [480176ffff]: 4 changes artifact: 7d1b6584be user: dgp
04:01 • Add attachment global.patch to ticket [480176ffff] artifact: 2d4a05ccc3 user: dgp
2001-11-09
20:43 • New ticket [480176ffff] global :v makes wrong link. artifact: e25e56b998 user: dgp

[global :v] makes wrong link

Closed / Fixed480176ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-11-09 20:43:03
% proc test {} {
      global :v
      set v 1
      set :v 2
}
% test
2
% set :v
1

[global] is linking global variable :v
to local variable v, rather than the
correct local variable :v.

Workaround: [global $varName] should
be equivalent to 
[upvar #0 $varName [namespace tail $varName]]
so one could just define it so.
dgpplain2001-11-10 04:01:56
File Added - 13090: global.patch

Logged In: YES 
user_id=80530

Here's the patch.
dgpplain2001-11-10 06:09:20
Logged In: YES 
user_id=80530

committed patch to HEAD and core-8-3-1-branch
Log in (anonymous is fine) to add a comment.

Attachments: