On Mon, May 13, 2013 at 12:21 PM, Oliver Sims <
oliver.s...@simsassociates.co.uk> wrote:

> **
> I have classes and a couple of mixins as in the following test program:
>
> c = .MyClass~new
> c~doIt
> ::class MyClass subclass Class1
> ::class Class1 subclass Class2 inherit MixinA MixinB
> ::class Class2
> ::class MixinA mixinclass Class2
>   ::method doIt;  say "MixinA caught it."
> ::class MixinB mixinclass Object
>   ::method doIt;  say "MixinB caught it."
> The result is "MixinA caught it".
>
> However, if I change the order of "inherit" in the Class1 directive to:
>
>  ::class Class1 subclass Class2 inherit MixinB MixinA
>
> then the result is "MixinB caught it".
>
> However, I sort of expected that both MixinA *and* MixinB would be invoked.
>


Staffan is pretty much correct.  The method in the first class in the
inheritance chain is going to be invoked.  Only 1 method is going to be
invoked, not both.

This is no different than:

::class 'One'
::method myMethod
::method myOtherMethod

::class 'Two' inherit One
::method myMethod
::method someOtherMethod

obj = .Two~new
obj~myMethod

obj~myMethod is going to invoke the method in class Two.  It is not going
to invoke both methods.  In order to invoke myMethod() in class Two unless
you forward the message to it.

I'm not 100% sure if forward class (super) will forward to the mixin class
or Class2.  I would forward directly to the mixin class instead of super.

PLEASE send me the info to reproduce the crash you reported.

--
Mark Miesfeld
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to