View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] Problem with slots and moving objects

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Tue, 28 Sep 2010 11:06:17 +0200

  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
_at_@ -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
          }
        }