Contents
Page-10
Prev
Next
Page+10
Index
Message Sending
Sending a message is just a function call. However, the function
( method) that is called is determined dynamically by
the runtime type of the object to which the message is sent.
Sending a message to an object,
(send obj draw x y) or obj.draw(x, y)
involves the following steps:
- Find the method corresponding to the message selector.
If the runtime object is a circle, the draw method
would be looked up as circle-draw.
- Assemble the arguments:
- The object to which the message was sent
(the self or this argument)
- Other arguments included in the message
- Call the method function with the arguments.
- Return the result returned by the method.