[self-interest] A problem about tiebreaker rule in inheritance
Jecel Assumpcao Jr
jecel at merlintec.com
Fri Jan 16 16:23:49 UTC 2004
On Friday 16 January 2004 13:55, Gordon Cichon wrote:
> cyberbaixing wrote:
> >Below are five objects A,B,C,D and E. As usual, a * denotes a parent
> >slot with more *'s indicating lower priority. f and g are method
> >slots with g sending the message f to self.
> >
> >A: p1**= B
> > p2* = C
> >B: p1* = C
> > p2* = D
> >C: f =(..)
> >D: p* = E
> > f =(..)
> >E: g= (..f..)
> >
> >If the parent prioritizing and the sender path tiebreaker rule is in
> >effect, how about the result of A f, B f, A g, B g.
Ok, your interpretations are correct except for B f, as Gordon
explained:
> I think that even with tiebreaker rule, ambiguities can arise. In
> this case, the VM recognizes an error and sends some "ambiguous
> message" message to that object instead.
That is exactly the error you would get when trying "B f". Actually, the
tiebreaker rule doesn't even come into play here. Now if the expression
was just "f" inside a method in either C or D executing as a result of
sending a message to B (still with me? ;-) *then* the tiebreaker rule
would allow you to choose correctly between C>>f and D>>f.
> I think that the tiebreaker rule has been abandoned in the later
> versions of self. The reason for this is AFAIK that they make lookup
> much more complex and still do not resolve all potential ambiguities.
It was eliminated in the Self 3.0. I hope my explanation in the previous
paragraph gave a hint of just how complex it was.
-- Jecel
More information about the Self-interest
mailing list