So when looking at how Smalltalk finds the implementation of a
method, one should consider sending a message to a class is really
sending a message to an instance of it's metaclass?
Yes! Although it seldom matters unless you’re manipulating classes beyond creating instances (or using class-side methods as utilities). So interesting messages like #superclass and #subclasses are not visible in the class-side of the browser but if you’re using those you’re probably pretty comfortable with looking at ClassDescription etc.
If you look
at it this way and follow the path starting at "Object class" it
leads you to Behavior. It seems like this works differently than
for user created classes where a class's superclass is the same as
it's metaclass' superclass' instance.
The hierarchy’s are parallel except in rare cases where a class has a superclass of nil (like ProtoObject):
ProtoObject superclass ====> nil
ProtoObject class superclass ====> Class
Of course if you now follow the superclass chain from Class you end up back at ProtoObject and then nil. So, in most cases the only important exception to “every class has a superclass (that is a Class)” is ProtoObject (or Object in some Smalltalk’s).
Btw, I think the diagram applies almost exactly to GNU
Smalltalk's model.
Good to know. Doesn’t reflect Pharo or Squeak which both have ProtoObject above Object but its close enough.