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

Re: [Xotcl] Issue with mixin delete

From: Scott Gargash <>
Date: Mon, 8 May 2006 17:03:58 -0600

Gustaf Neumann <> wrote on 05/08/2006 02:15:41 PM:

> > BTW, this will happen with any method, not just "destroy".
> >
> i know.
> >
> > 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?
> >
> removing a mixin class from the mixin list does not "corrupt" the chain
> in the sense that there
> is a memory corruption etc. The current implementation does not allow to
> remove
> ***active*** mixin classes, this are the classes of which the method is
> currently executing.

I did a little more experimenting, and it's a little stronger than that. You also can't remove a
mixin from anything invoked by the active mixin. I.e., you can't forward the "mixin delete" to an
object of another class. If the mixin to be deleted is present in the call stack, it appears that
the mixin can't be deleted. Not that I expected it to work, but it seems worth noting.

> It looks quite easy to give a reasonable error message, when the
> currently active
> mixin class is deleted, it will be more expensive to handle this problem in
> a friendly way.

Is the expense something that would be encountered on every method invocation, or would it only be
paid when deleting a mixin?

I really ought to spend some time with the source...