<div dir="ltr">Actually, you cannot send new to _any_ object, just to instances of Behavior (that implements new) and its subclasses (as with any<div>other message, no magic here). The question then is how come let's say Object, which is not apparently linked anyway to Behavior,</div><div>answers `new`?</div><div><br></div><div>The answer there is in Object class, because it (and all of its superclass chain) defines what messages Object can understand. You</div><div>can inspect `Object class withAllSuperclasses` to see the inheritance chain. </div><div><br></div><div>The key insight here is that there is an artificial link hiding there, that makes the whole thing *just work*: the superclass of ProtoObject</div><div>class. From the point of view of a developer looking at Class in a browser, Class has no subclasses. However, it actually has one,</div><div>ProtoObject class.</div><div><br></div><div>The nicest thing is that you can just inspect ProtoObject class and Class objects to see how they are internally linked (i.e look at Class</div><div>`subclasses` instance variable) until you clear all your doubts! And while you can't directly access the VM lookup mechanism, you can</div><div>use an equivalent version implemented in Smalltalk, and debug the whole process, with the expression `Object class lookupSelector: #new`</div><div><br></div><div>HTH, cheers!</div><div>Pocho</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 12, 2024 at 10:31 AM Mark Volkmann via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I understand that Object is a subclass of ProtoObject and that the `basicNew` and `new` methods are defined in Behavior. But I can't find a relationship between Object and Behavior, or between ProtoObject and Behavior. Can someone explain how it is that I can send `#new` to any object? How does it find that method in `Behavior`? I tried to use the debugger to discover the answer, but that didn't help me to find the answer.<br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>