Tcl Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.
Ticket UUID: 572889
Title: upvar links do not fire array read trace
Type: RFE Version: None
Submitter: dgp Created on: 2002-06-23 21:43:28
Subsystem: 46. Traces Assigned To: dgp
Priority: 5 Medium Severity:
Status: Open Last Modified: 2003-06-26 23:07:55
Resolution: None Closed By:
    Closed on:
Description:
% set a(foo) 1
1
% trace variable a r {puts a ;#}
%  set a(foo)
a
1
% upvar 0 a(foo) baz
%  set baz
1

I would like to see the trace fire when
I read from baz.
User Comments: dgp added on 2003-04-18 13:28:07:
Logged In: YES 
user_id=80530


Joe, you were asking about this on the chat.

dgp added on 2002-06-25 00:09:53:
Logged In: YES 
user_id=80530

Thanks.  If this is to change, it would be a FR/TIP.
Don't feel strong enough about it to do that now,
but I'll shift this over the FR tracker in case
anyone else wants to pick it up.

Note to self: read *all* relevant man pages before
filing bugs...

Workaround seems to be to set traces on both
the source and target of the [upvar].  Works fine,
then, if annoying.

msofer added on 2002-06-24 23:56:38:
Logged In: YES 
user_id=148712

upvar.n dixit: "If otherVar refers to an element of an
array, then variable traces set for the entire array will
not be invoked when myVar is accessed (but traces on the
particular element will still be invoked). In particular, if
the array is env, then changes made to myVar will not be
passed to subprocesses correctly."

So, is this a bug or a FR? Does it need a TIP?