I'm using 8.4.7 and I find that I cannot delete a trace
using "trace remove variable" while I can with the soon-
to-be-obsolete "trace vdelete".
Example script:
proc Trace {var1 var2 op} {puts "in
Trace: '$var1' '$var2' '$op'"}
trace variable myVar w Trace
trace info variable myVar ;# There it is
trace remove variable myVar w Trace ;# error
must be "write"
trace remove variable myVar write Trace
trace info variable myVar ;# Still there
trace vdelete myVar w Trace ;# works
trace info variable myVar ;# gone
Keith
Logged In: YES
user_id=80530
confirmed on the core-8.4
tip of development and on
the HEAD.
This likely traces back to
a mistaken implementation
choice that kept support for
the old subcommands in place
with a separate set of code from
the new subcommands, rather
than doing it wrapper style
with the old name ultimately
invoking the new implementation.
Thanks for the bug report.
Until a fix shows up, work around
it by balancing [trace variable] with
[trace vdelete] and [trace add] with
[trace remove].
Logged In: YES
user_id=80530
after looking into this, it seems that
because the [trace] syntax changed
at the same time that the acceptable
values for variable trace operations
changed (rwua -> read write unset array),
the consequence is the two forms of
variable traces are not interchangeable.
(They differ notably in the ops arguments
passed to the trace itself). So, the only
viable workaround it to just be consistent.
Either stick with the old form, or convert
fully to the new form. Don't try to mix and
match.
Logged In: YES
user_id=80530
oops. spoke too soon. Got a fix
coming after all.
Logged In: YES
user_id=80530
Here's a patch.
Logged In: YES
user_id=80530
fixed for 8.4.8 and 8.5a2.