Consider the following class hierarchy:
Object subclass: #A ... "Methods of A" g ^ 'dog" A subclass: #B ... "Methods of B" h ^ self g B subclass: #C ... "Methods of C" f ^ super g g ^ 'cat' i ^ self h C subclass: #D ... "Methods of D" h ^ 'mouse' i ^ super i
The semantics of method dispatch are as follows:
Super sends look up the static class to which the enclosing method belongs, and begin method lookup at the superclass of this class.
Note that a super send does not change the lookup strategy for future message sends---only the current one.
What are the values of the following expressions? (Try them in Squeak if you can't figure them out.)
(D new) h. (D new) f. (C new) h. (C new) i. (D new) i.