<div dir="ltr"><div>Hi Marcel, of course you already know all this :)<br></div><div>a message is composed of a receiver, a selector and arguments.</div><div>a (Compiled)Method holds the instructions to be executed in response to a message.</div><div>The methods are stored by object class (and superclasses...) in methodDictionary.</div><div>In response to a message, the appropriate method is selected by the receiver by looking up for the message selector in methodDictionary.</div><div>The instructions consist mostly of pushing/popping objects between the stack and object slots or method args/temps, and sending messages.</div><div><br></div><div>What Eliot is saying is simply that we should call a spade a spade.</div><div>So one could expect (self sendMessage: aMessage), (self sendSelector: aSelector), but not (self sendMessage: aSelector) nor (self sendSelector: aMessage).<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 12 déc. 2019 à 09:10, Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> a écrit :<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><div id="gmail-m_8645308190988709553__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
                                        Hi Eliot,<div><br></div><div>how would you define selector, message, (message) send, and method? It seems like a "message" is a very high-level concept. Selectors and methods seem to be more on the implementation side and thus the right names to use for such reflection over compiled code.</div><div><br></div><div>Project >> #addDeferredUIMessage:</div><div>CompiledCode >> #abstractBytecodeMessageAt:</div><div>SystemNavigation >> #allSentMessages</div><div>...</div><div><br></div><div>Best,</div><div>Marcel</div><div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 11.12.2019 20:50:30 schrieb <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of Kernel was added to project The Inbox:<br><a href="http://source.squeak.org/inbox/Kernel-eem.1285.mcz" target="_blank">http://source.squeak.org/inbox/Kernel-eem.1285.mcz</a><br><br>==================== Summary ====================<br><br>Name: Kernel-eem.1285<br>Author: eem<br>Time: 11 December 2019, 11:50:19.928718 am<br>UUID: 3dce70bd-9166-47fe-a86f-22456db9845a<br>Ancestors: Kernel-mt.1284<br><br>Commit my own take on sendsSelector: vs sendsMessage:, and selectorsDo: vs messagesDo:.  IMNERHO sendsMessage: messagesDo: are *wrong*!! :-)  c.f. Behavior>>selectorsDo:<br><br>=============== Diff against Kernel-mt.1284 ===============<br><br>Item was changed:<br>  ----- Method: CompiledCode>>messagesDo: (in category 'scanning') -----<br>  messagesDo: workBlock<br>+  "Evaluate aBlock with all the message selectors sent by me. Duplicate seletors are possible."<br>-      "Evaluate aBlock with all the message selectors sent by me. Duplicate sends possible."<br>  <br>+         "If anything should be deprecated it is messagesDo:; it can be an extension in AST/Refactoring.<br>+          This method enumerates over selectors, not messages.  c.f. Behavior>>selectorsDo: etc"<br>+   ^self selectorsDo: workBlock!<br>-        | scanner selector  |<br>-        self isQuick ifTrue: [^ self].<br>-       <br>-     self codeLiteralsDo: [:compiledCode | <br>-               scanner := InstructionStream on: compiledCode.<br>-               scanner scanFor: [ :x | <br>-                     (selector := scanner selectorToSendOrSelf) == scanner<br>-                                ifFalse: [workBlock value: selector].<br>-                        false "keep scanning" ] ].!<br><br>Item was added:<br>+ ----- Method: CompiledCode>>selectorsDo: (in category 'scanning') -----<br>+ selectorsDo: workBlock<br>+  "Evaluate aBlock with all the message selectors sent by me. Duplicate seletors are possible."<br>+ <br>+  self isQuick ifTrue: [^self].<br>+        <br>+     self codeLiteralsDo:<br>+                 [:compiledCode | | scanner |<br>+                 (scanner := InstructionStream on: compiledCode) scanFor:<br>+                     [:x| | selector |<br>+                    (selector := scanner selectorToSendOrSelf) ~~ scanner ifTrue:<br>+                                [workBlock value: selector].<br>+                         false "keep scanning"]]!<br><br>Item was changed:<br>  ----- Method: CompiledCode>>sendsMessage: (in category 'testing') -----<br>+ sendsMessage: aSelector<br>+  "eem: this should be deprecated. This method does not check if a method sends a message;<br>+         it checks if a method sends a message with a particular selector."<br>+     self flag: #todo.<br>- sendsMessage: aSelector <br>-        <br>      self messagesDo: [:selector |<br>                 selector = aSelector ifTrue: [^ true]].<br>       ^ false!<br><br>Item was changed:<br>  ----- Method: CompiledCode>>sendsSelector: (in category 'testing') -----<br>  sendsSelector: aSelector <br>+         "Answer if the receiver sends a message whose selector is aSelector."<br>  <br>+  self selectorsDo:<br>+            [:selector | selector = aSelector ifTrue: [^true]].<br>+  ^false!<br>-      self flag: #todo. "mt: Deprecate? AST/Refactoring project needs it..."<br>-     ^ self sendsMessage: aSelector!<br><br><br></div></blockquote>
                                        </div></div><br>
</blockquote></div>