ambiguous inheritance question

David Ungar david.ungar at Sun.COM
Thu Feb 2 01:34:04 UTC 1995

Great question--we almost implemented it that way at Stanford.
I think it would be very interesting to try living with it--
could be really bad, could be really good--I have a high degree of
uncertainty. It does remind me of some of the bad mistakes I
have made in the past.

- Dave

 ------ From: Ivan Moore, Tue, Jan 31, 1995 ------ 

Dear Self interest group,

What are peoples opinions on the following:

given an inheritance hierarchy as below:

              / \
             B   C
              \ /

where B and C are parents of D, and A is the parent of B and C,

If A defines slot m, and B defines its own version of slot m, if you send D 
the message m, you get an ambiguous selector error (as expected).

How about if D got the m in B, because it does override the one in A,
after-all. What I mean is that the m in B overrides the very same slot m that
inherits via C. If it was a different m that it was overriding I'd be totally
happy with an ambiguous selector error.

What do you think? Would the proposed scheme invite obscure bugs? Would it
be difficult to understand? You may think that this sort of situation doesn't
occur often enough to be a problem - maybe true - but dispite that, what do
you think?


More information about the Self-interest mailing list