Index: generic/predefined.h =================================================================== diff -u -re98952d7910953b095d701b913244ee4962c2b48 -rf4c5e835150b90501c5d871970114d7972a2b995 --- generic/predefined.h (.../predefined.h) (revision e98952d7910953b095d701b913244ee4962c2b48) +++ generic/predefined.h (.../predefined.h) (revision f4c5e835150b90501c5d871970114d7972a2b995) @@ -351,8 +351,11 @@ "if {$cmds ne \"\"} {\n" "foreach cmd $cmds {\n" "foreach {op def} $cmd break\n" -"if {[lindex $def 0] eq $origin} {\n" +"set domain [lindex $def 0]\n" +"if {$domain eq $origin} {\n" "set def [concat $dest [lrange $def 1 end]]}\n" +"if {[my isobject $domain] && [$domain istype ::xotcl::Slot]} {\n" +"continue}\n" "$dest trace add variable $var $op $def}}}}\n" "set origin [lindex [::xotcl::my set targetList] 0]\n" "if {[::xotcl::my isclass $origin]} {\n" Index: generic/predefined.xotcl =================================================================== diff -u -re98952d7910953b095d701b913244ee4962c2b48 -rf4c5e835150b90501c5d871970114d7972a2b995 --- generic/predefined.xotcl (.../predefined.xotcl) (revision e98952d7910953b095d701b913244ee4962c2b48) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision f4c5e835150b90501c5d871970114d7972a2b995) @@ -596,9 +596,14 @@ foreach cmd $cmds { foreach {op def} $cmd break #$origin trace remove variable $var $op $def - if {[lindex $def 0] eq $origin} { + set domain [lindex $def 0] + if {$domain eq $origin} { set def [concat $dest [lrange $def 1 end]] } + if {[my isobject $domain] && [$domain istype ::xotcl::Slot]} { + # slot traces are handled already by the slot mechanism + continue + } $dest trace add variable $var $op $def } } Index: tests/slottest.xotcl =================================================================== diff -u -ra976b7c6a116f584114d2612494aaaa8e8028387 -rf4c5e835150b90501c5d871970114d7972a2b995 --- tests/slottest.xotcl (.../slottest.xotcl) (revision a976b7c6a116f584114d2612494aaaa8e8028387) +++ tests/slottest.xotcl (.../slottest.xotcl) (revision f4c5e835150b90501c5d871970114d7972a2b995) @@ -688,6 +688,12 @@ t {o1 myset x} 101 "get instvar value via set alias" t {o1 myset x 123} 123 "set instvar value via set alias" +Class Fred -slots { Attribute create a -initcmd { set _ 4 } } +? {Fred x} ::x +? {x a 4} 4 +x move y +? {y a} 4 + exit # t {p1 age} 0 "slot read"