Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-08-09
19:21 • Closed ticket [1770591fff]: whole array write traces on compiled locals do not f... artifact: 155beeb17a user: msofer
17:57 • Ticket [1770591fff]: 6 changes artifact: a507f5ca72 user: msofer
05:05 • New ticket [1770591fff]. artifact: d23152f930 user: nyademo

whole array write traces on compiled locals do not fire

Closed / Fixed1770591fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-08-09 05:05:33
Tcl8.5a7 HEAD
Windows2000SP2/Mingw


proc testInit {} {
    global env
    if {![info exists env(TEST)]} {
        set env(TEST) testval
    }
}
testInit

if {[catch {
    puts $env(TEST)
} msg]} {puts Error:$msg}


I expected to output "testval", but the result was
Error:can't read "env(TEST)": no such variable.
It caused a breakdown of the Tktable's init script too.
msoferplain2007-08-09 17:57:18
Logged In: YES 
user_id=148712
Originator: NO

The problem is not specific to env; it is also the likely cause of three current failures in the tcllib testsuite.

It is also not specific to [global]; links created by [variable] or [upvar] fail in the same way.

% trace add variable x write {puts x!;#}
% proc q {} {global x; set x(1) 2}; q
2
msoferplain2007-08-09 19:21:28
Logged In: YES 
user_id=148712
Originator: NO

The problem is on write traces on compiled local arrays:
% proc a {} {trace add variable x write {puts x!;#}; set x(1) 2}; a
2

Fixed in HEAD, test trace-2.6 added; tcllib's testsuite error-free too!
Log in (anonymous is fine) to add a comment.