Search code examples
classsmalltalkmessagesqueak

Smalltalk / Squeak message handling method


A pretty short question - how is the message handling method named (the first method that is called on message passing), and in which class it is defined?


Solution

  • Sending a message to an object is handled by the VM, you won't find the specific method that handles it.

    However, ContextPart>>#send:to:with:super: contains an implementation that should be identical to how the VM is implemented. In particular, it calls Behavior>>#lookupSelector:, where you can see the code that climbs up the inheritance hierarchy.