<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Actually, FullBlockClosure >> home should be fixed too (returns nil for outerContext = nil):</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">FullBlockClosure >> home<o:p></o:p></p>
<p class="MsoNormal">                ^ outerContext ifNotNil: [ outerContext home ]</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Fix:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">FullBlockClosure >> home</p>
<p class="MsoNormal">                outerContext ifNotNil: [ ^outerContext home ]</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:mail@jaromir.net">Jaromir Matas</a><br>
<b>Sent: </b>Sunday, February 12, 2023 23:44<br>
<b>To: </b><a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.squeakfoundation.org</a>;
<a href="mailto:eliot.miranda@gmail.com">Eliot Miranda</a><br>
<b>Subject: </b>Re: [squeak-dev] The Trunk: Kernel-eem.1498.mcz</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Eliot,<o:p></o:p></p>
<p class="MsoNormal">I guess the same fix should apply for #methodReturnContext.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I wanted to ask about this: #home and #methodReturnContext are synonymous; why is that? Some backward compatibility thing or historical reasons?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Similarly I’ve noticed #method and #homeMethod seem synonymous too if I’m not mistaken (in BlockClosure and FullBlockClosure). Is it intentional?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Jaromir<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#8FAADC"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From: </b><a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a><br>
<b>Sent: </b>Sunday, February 12, 2023 22:31<br>
<b>To: </b><a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.squeakfoundation.org</a>;
<a href="mailto:packages@lists.squeakfoundation.org">packages@lists.squeakfoundation.org</a><br>
<b>Subject: </b>[squeak-dev] The Trunk: Kernel-eem.1498.mcz<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Eliot Miranda uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-eem.1498.mcz">http://source.squeak.org/trunk/Kernel-eem.1498.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-eem.1498<br>
Author: eem<br>
Time: 12 February 2023, 1:30:55.883243 pm<br>
UUID: e8b69d4d-8a07-4cf8-8ee7-d764b47f1981<br>
Ancestors: Kernel-tpr.1497<br>
<br>
In implementing BlockClosure>>hasMethodReturn, don't assume the byutecode set.<br>
<br>
Implement Context>>#home so that it will code with clean blocks.<br>
<br>
=============== Diff against Kernel-tpr.1497 ===============<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>hasMethodReturn (in category 'testing') -----<br>
  hasMethodReturn<br>
         "Answer whether the receiver has a method-return ('^') in its code."<br>
         | scanner endpc |<br>
+        scanner := InstructionStream new method: self method pc: startpcOrMethod.<br>
-        scanner := InstructionStream new method: outerContext method pc: startpcOrMethod.<br>
         endpc := self endPC.<br>
+        scanner scanFor:<br>
+                [:byte |<br>
+                scanner willReturn ifTrue:<br>
+                        [scanner willBlockReturn ifFalse:<br>
+                                [^true]].<br>
+                scanner pc >= endpc].<br>
+        ^false!<br>
-        scanner scanFor: [:byte | (byte between: 120 and: 124) or: [scanner pc > endpc]].<br>
-        ^scanner pc <= endpc!<br>
<br>
Item was changed:<br>
  ----- Method: Context>>home (in category 'accessing') -----<br>
  home <br>
+        "Answer the outermost context (along the static chain) for the receiver.<br>
+         This is the outermost lexical scope in which the receiver's method is defined."<br>
-        "Answer the context in which the receiver was defined."<br>
  <br>
+        ^closureOrNil<br>
+                ifNil: [self] "normal method activation"<br>
+                ifNotNil:       "block activation"<br>
+                        [:closure|<br>
+                         closure outerContext<br>
+                                ifNil: [self] "clean block"<br>
+                                ifNotNil: [:outerContext| outerContext home]] "normal block"!<br>
-        closureOrNil == nil ifTrue:<br>
-                [^self].<br>
-        ^closureOrNil outerContext home!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>