tcl-trace



I am using tcl-trace since a very long time, but today I am baffled at
the following behaviour (may be I am just overworked ;-):

proc testeTclTrace {} {
puts "[info level 0] Tcl$::tcl_patchLevel"
set ::a 0
proc ::trc {args} { puts " [info level 0] a = [set ::a]" }
trace add variable ::a {write unset} "::trc"
incr ::a
trace add variable ::a {write unset} "::trc"
incr ::a
trace add variable ::a {write unset} "::trc"
unset ::a
}

I get the following result:

testeTclTrace Tcl8.4.13
::trc ::a {} write a = 1
::trc ::a {} write a = 2
::trc ::a {} write a = 2

Where is the 'unset'-trace call?
Why do I get the 'write'-trace multiple times? (I thought, when I
register the very same command twice, it still gets called just once?!)

regards,
- Florian

.