<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Eliot,</p>
<p><br>
</p>
<p>please correct me if I am wrong - I am just learning how to upload to Trunk properly -, but shouldn't you have based your version on Kernel-ct.1426 instead? Or did I upload anything wrong? We now have two "head" versions for the Kernel repository:</p>
<p><br>
</p>
<p><img size="47414" id="x_img681985" tabindex="0" style="max-width:99.9%" src="cid:e37defc6-75c2-4253-a033-48812c0ddd10"><br>
</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Samstag, 27. November 2021 22:02:18<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Kernel-eem.1426.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Eliot Miranda uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-eem.1426.mcz">http://source.squeak.org/trunk/Kernel-eem.1426.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-eem.1426<br>
Author: eem<br>
Time: 27 November 2021, 1:02:15.155642 pm<br>
UUID: 9ca49d5c-f988-4848-a26b-53b1f79d64a2<br>
Ancestors: Kernel-ct.1425<br>
<br>
Implement protection against infinite recursion of doesNotUnderstand: within Object>>doesNotUnderstand:.<br>
<br>
Note: this implementation puts the additional error handler within Object>>doesNotUnderstand: and sends error: to the receiver on detecting recursion.  An alternative might be to introduce a protected form of sentTo:, which would more naturally send error to
 the message.  e.g. either of<br>
<br>
Message methods for sending<br>
sentWithProtectionAgainstRecursiveDoesNotUnderstandTo: receiver<br>
        "Answer the result of sending this message to receiver, within a guard to<br>
         protect against infinite recursion."<br>
<br>
        ^[self sentTo: receiver]<br>
                on: MessageNotUnderstood<br>
                do: [:ex|<br>
                        (receiver == ex receiver<br>
                        and: [self hasIdenticalContentsAs: ex message]) ifTrue:<br>
                                [receiver error: 'infinite recursion in doesNotUnderstand:'].<br>
                        ex pass]<br>
<br>
or<br>
<br>
sentWithProtectionAgainstRecursiveDoesNotUnderstandTo: receiver<br>
        "Answer the result of sending this message to receiver, within a guard to<br>
         protect against infinite recursion."<br>
<br>
        ^[self sentTo: receiver]<br>
                on: MessageNotUnderstood<br>
                do: [:ex|<br>
                        (receiver == ex receiver<br>
                        and: [self hasIdenticalContentsAs: ex message]) ifTrue:<br>
                                [self error: 'infinite recursion in doesNotUnderstand:'].<br>
                        ex pass]<br>
<br>
I think this is too elaborate. Adding Message>>hasIdenticalContentsAs: is the key to making all variants concise enough.<br>
<br>
=============== Diff against Kernel-ct.1425 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Message>>hasIdenticalContentsAs: (in category 'comparing') -----<br>
+ hasIdenticalContentsAs: aMessage<br>
+        "Answer if the argument's selector and arguments are identically equal to those of the receiver.<br>
+         It is assumed that the argument aMessage is, in fact, a message."<br>
+        selector ~~ aMessage selector ifTrue:<br>
+                [^false].<br>
+        1 to: args size do:<br>
+                [:i| (args at: i) ~~ (aMessage arguments at: i) ifTrue: [^false]].<br>
+        ^true!<br>
<br>
Item was changed:<br>
  ----- Method: Object>>doesNotUnderstand: (in category 'error handling') -----<br>
  doesNotUnderstand: aMessage <br>
          "Handle the fact that there was an attempt to send the given<br>
           message to the receiver but the receiver does not understand<br>
           this message (typically sent from the machine when a message<br>
+          is sent to the receiver and no method is defined for that selector).<br>
-         is sent to the receiver and no method is defined for that selector)."<br>
  <br>
+         Raise the MessageNotUnderstood signal.  If it is caught, answer<br>
+         the result supplied by the exception handler.  If it is not caught,<br>
+         answer the result of resending the message within a guard for<br>
+         infinite recursion. This allows, for example, the programmer to<br>
+         implement the method and continue."<br>
+ <br>
         "Testing: (3 activeProcess)"<br>
  <br>
         | exception resumeValue |<br>
         (exception := MessageNotUnderstood new)<br>
                 message: aMessage;<br>
                 receiver: self.<br>
         resumeValue := exception signal.<br>
+        ^exception reachedDefaultHandler "i.e. exception was not caught..."<br>
+                ifTrue:<br>
+                        [[aMessage sentTo: self]<br>
+                                on: MessageNotUnderstood<br>
+                                do: [:ex|<br>
+                                        (self == ex receiver<br>
+                                        and: [aMessage hasIdenticalContentsAs: ex message]) ifFalse:<br>
+                                                [ex pass].<br>
+                                        self error: 'infinite recursion in doesNotUnderstand:']]<br>
-        ^exception reachedDefaultHandler<br>
-                ifTrue: [aMessage sentTo: self]<br>
                 ifFalse: [resumeValue]!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>