[Xotcl] Problem with slots and moving objects

Gustaf Neumann neumann at wu-wien.ac.at
Tue Sep 28 11:06:17 CEST 2010


  Dear Neil,

many thanks for the (most likely condensed) example.
The bug was that the traces from initcmd were handled twice
by copy/move, one time correctly, the other time not
(Stefan's patch from 2'oclock fixes the second copy and
removes the duplicates later, but removes too many
traces).

See below for a patch against xotcl 1.6.6.
We'll do some more testing, but this or a similar patch
will go into the next releases (as well the 2.0 branch).

For now, you might get the fixed version from:
    git clone git://alice.wu-wien.ac.at/xotcl

best regards
-gustaf neumann


===================================================
--- a/generic/predefined.xotcl
+++ b/generic/predefined.xotcl
@@ -596,9 +596,14 @@ unset p
          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
          }
        }



More information about the Xotcl mailing list