1. Read the first ten pages of chapter 11. (a) What is a "receiver"? What is an "argument"? What is the difference? (b) What is the relationship between a _message_ and a _protocol_? (c) What is the difference between _instance_ protocol and _class_ protocol? (d) In the name of a message, what is the significance of a colon or colons? You are ready for exercise 9 (collection protocols). 2. Read Section 11.3.4 on message send and dynamic dispatch. Using the class definitions in that section, message `m1` is sent to an object of class `C`: What method *definitions* are evaluated in what order? An answer looks something like "method m5 on class H, then method m12 on class E, ...". 3. Continuing with method dispatch, now study the *class* method `new` defined on class `List` in code chunk 927a. The definition sends message `new` to `super`. (Keep in mind: because `new` is a *class* method, both `super` and `self` stand for the class, not for any instance.) (a) When *class* method `new` is evaluated, what three messages are sent by the method body, in what order? (b) What does each message send accomplish? (c) If we changed the body so instead of `(new super)` it said `(new self)`, what would happen? 4. Find the implementation of class `Number` on pages 933 and 934. Now study the implementation of class `Fraction` pages 936 to 938. Message `-` (minus) is sent to `Fraction` `(/ 1 2)` with argument `Fraction` `(/ 1 3)`. What methods are evaluated in what order? Which class implements `-`? You are getting ready for exercise 30(a). 5. Read about the `Magnitude` protocol on pages 894 and 895. Study the implementation of class `Magnitude` on page 932. Then study the implementations of classes `Integer` and `SmallInteger` on pages 934 and 935. Message `<=` is sent to small integer 3 with argument 9. What methods are evaluated in what order? Which class implements `<=`? You are ready for exercise 30(a), and you are ready to implement class `Natural` (exercise 32). 6. In section 11.10.1 on page 978, you will find a short definition of an "abstract class." What do you think is the purpose of an abstract class? 7. One example of an abstract class is class `Number`. Look up its definition on page 933. List all the methods that are "subclass responsibility." These are the methods you must implement in class `LargeInteger`. You are getting ready to implement large integers. 8. Study the implementation of common methods on classes `Magnitude` and `Number`. This question asks you to apply the ideas to `LargeInteger`: Of the methods listed in the previous comprehension question (subclass responsibilities of `Number`), which ones can be implemented on class `LargeInteger` itself, as opposed to one of its concrete subclasses? (None of these methods will require double dispatch, which is the subject of the next comprehension question.) You are ready to write a few simple methods for Exercise 33 (large integers). 9. Read Section 11.6.4 on pages 931 and 932. Of the methods listed in comprehension question 7 (subclass responsibilities of `Number`), list each one that needs to know whether its *argument* (not the receiver) is a large or small integer, and if large, whether it is positive or negative. These methods will require double dispatch. (a) List the methods. For example, `+` is such a method. (b) For each method, list what method it will dispatch to on its argument if the received is a `LargePositiveInteger`. For example, method `+` will dispatch to `addLargePositiveIntegerTo:`. You are ready to implement large integers (Exercise 33). 10. Read about coercion in section Section 11.4.5 on page 895. Look at the protocol on page 894. Explain the roles of the methods `asInteger`, `asFraction`, `asFloat`, and `coerce:`. If you are unsure, look at the implementations of these methods on class `Integer` on pages 934 and 935. You are ready to implement mixed arithmetic, with coercions, in Exercise 34.