Tcl Source Code

View Ticket
Login
Ticket UUID: 480176
Title: [global :v] makes wrong link
Type: Bug Version: obsolete: 8.4a4
Submitter: dgp Created on: 2001-11-09 20:43:03
Subsystem: 07. Variables Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-11-10 06:09:20
Resolution: Fixed Closed By: dgp
    Closed on: 2001-11-09 23:09:20
Description:
% 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.
User Comments: dgp added on 2001-11-10 06:09:20:
Logged In: YES 
user_id=80530

committed patch to HEAD and core-8-3-1-branch

dgp added on 2001-11-10 04:01:56:

File Added - 13090: global.patch

Logged In: YES 
user_id=80530

Here's the patch.

Attachments: