# Here is the variable-tracing routine from the book. # trace variable color w pvar # trace variable a(length) w pvar proc pvar {name element op} { if {$element != ""} { set name ${name}($element) } upvar $name x puts "Set $name to \"$x\"" }