[Xotcl] Issue with mixin delete

Scott Gargash scottg at atc.creative.com
Mon May 8 21:42:55 CEST 2006






Gustaf Neumann <neumann at wu-wien.ac.at> wrote on 05/06/2006 05:10:24 PM:

> Scott Gargash schrieb:
> >
> > Hello,
> >
> > I've run into an issue when trying to remove a mixin from an object.
> > It appears that removing a mixin from an object interacts with the
> > method chaining, such that the "next" isn't invoked.
> >
> scott,
>
> in your example, you are trying to delete the currently active mixin
> from the mixin list (xotcl needs it
> currently to continue from that point in the mixin chain), and then you
> are deleting the object anyhow.
> Most probably, we should rise an error in such cases.
>
> what is your intention, what lead you to this construction?

In my particular case, I'm manipulating a graph.  Some nodes have mixins that are used to notify
other connected nodes.  When a node (with this particular mixin) is destroyed, it notifies connected
nodes that it's being disconnected. Another mixin class later in the chain intercepts the destroy
call and moves the node back to a pool (the nodes manipulate a fixed pool of hardware resources, so
they need to be tracked and reused).  Since "move" reinvokes the destructor, if I don't remove the
notification mixin from the object, connected nodes are doubly notified (bad), but when I remove the
mixin, I don't get the correct chaining behavior and resource reclamation.

BTW, this will happen with any method, not just "destroy".  Is it not considered acceptable to ever
remove a mixin class?   When is it valid to remove a mixin if removing it corrupts the method
chaining?

      Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://alice.wu-wien.ac.at/pipermail/xotcl/attachments/20060508/156ee794/attachment.html


More information about the Xotcl mailing list