A problem about tiebreaker rule in inheritance

cyberbaixing cyberbaixing at yahoo.com.cn
Fri Jan 16 15:24:37 UTC 2004


Dear Jecel,

When I study the concept of sender path tiebreaker rule, I meet such 
an exercise like this:

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.

I think the result of A f is C f since p2 in A has a higher priority.
Both A g and B g are E g. I think the result of B f is D f. Because D 
has a parent E is sending message. Thus, D has higher priority than 
C. I am not sure my answer. Since one of my friend told me the result 
of B f should be wrong since C and D are the parents which have the 
same priority. 

Many thanks.
--Xing





More information about the Self-interest mailing list