On Dec 16, 2010, at 10:28 PM, Jim mack wrote:

> I haven't figured out how to debug/step into inheritance chains/method order 
> choosing.

bro2 is both a member of power1 (through "dad") and power2. There's no 
hierarchical relationship implied between "power1" and "power2" (both classes 
are open union classes and neither class is necessarily a subset of the other), 
so when you invoke "content" on a bro2, it's ambiguous as to whether the 
"power1" or "power2" method should be called. In ambiguous cases, the 
union/mixin dispatch currently dispatches on the first asciibetical class for 
which it finds a method, in this case "power1". To get the behavior you want, 
you need to make power2 a member of power1, thereby mirroring the tuple 
inheritance hierarchy in the mixin hierarchy:

MIXIN: power1
MIXIN: power2

TUPLE: dad ;
TUPLE: bro1 < dad ;
TUPLE: bro2  < dad ; 

INSTANCE: power2 power1
INSTANCE: dad  power1
INSTANCE: bro2 power2

Since "power2" is now explicitly a subset of "power1" it will be treated as 
more specific, and "power2" methods will override "power1" methods.

-Joe

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to