<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p>Take this as a memo for myself -- of course, it would be great to hear your ideas about the following points!</p>
<p><br>
</p>
<p>Further steps:</p>
<p><br>
</p>
<p></p>
<ul style="margin-bottom: 0px; margin-top: 0px;">
<li>Implement the same return logic for #while(True|False)[:]. This might also require changes in the Compiler.</li><li>
<div>Inline #whileNil(:) implementation as well.<br>
General question: Is there such a thing as "too much inlining"? Would it be desirable to inline #cull: and others? Where do we draw the line between performance and Smalltalk-essential explorability?</div>
</li><li>
<div><span style="font-size: 12pt;">Implement all these controlling methods in a way that could work without inlining (though slow). At the moment, #whileTrue: refers to itself.<br>
An approach that completely foregos inline code would either need to use recursion (linear complexity) or "thisContext restart" (constant time complexity).</span></div>
</li><li>Should we maybe find a way to highlight methods that are inlined? For example, by using a pragma <inlined>. Or rather ask Encoder for it than storing this information in the methods.<br>
<span style="font-size: 12pt;">Should we warn or forbid the user to overri</span><span style="font-size: 12pt;">d</span><span style="font-size: 12pt;">e (or even
</span><span style="font-size: 12pt;">overwrite</span><span style="font-size: 12pt;">) such methods?</span>
<ul>
<li>Similar concern: It is dangerous to override #class et al., should we warn here, too?</li></ul>
</li></ul>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<br>
</div>
Best,</div>
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
Christoph<br>
<br>
<div style="color: rgb(0, 0, 0);">
<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> Dienstag, 3. März 2020 22:38 Uhr<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Kernel-ct.1295.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Nicolas Cellier uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-ct.1295.mcz">http://source.squeak.org/trunk/Kernel-ct.1295.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-ct.1295<br>
Author: ct<br>
Time: 24 January 2020, 5:20:51.814415 pm<br>
UUID: 18ea3b5d-ee42-2944-9d01-aa48e43207a7<br>
Ancestors: Kernel-nice.1292<br>
<br>
Extends BlockClosure >> #whileNil: by returning the final non-nil value. Adds #whileNil analogous to #whileTrue and #whileFalse.<br>
<br>
        [Project uiManager chooseFrom: #(foo bar) values: #(Foo Bar)] whileNil.<br>
<br>
        [Project uiManager chooseFrom: #(foo bar) values: #(Foo Bar)] whileNil: [self inform: 'You have to decide!']<br>
<br>
=============== Diff against Kernel-nice.1292 ===============<br>
<br>
Item was added:<br>
+ ----- Method: BlockClosure>>whileNil (in category 'controlling') -----<br>
+ whileNil<br>
+        "Unlike #whileTrue/False this is not compiled inline."<br>
+        | result |<br>
+        [(result := self value) isNil] whileTrue.<br>
+        ^ result<br>
+        !<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>whileNil: (in category 'controlling') -----<br>
  whileNil: aBlock <br>
         "Unlike #whileTrue/False: this is not compiled inline."<br>
+        | result |<br>
+        [(result := self value) isNil] whileTrue: [aBlock value].<br>
+        ^ result<br>
-        ^ [self value isNil] whileTrue: [aBlock value]<br>
         !<br>
<br>
<br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>