<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>Nice idea! Hmm... I can't figure out a real example, maybe something like this?</p>
<p><br>
</p>
<p></p>
<div>(1 to: 20) asArray shuffled</div>
<div>    do: [:ea | Transcript show: ea]</div>
<div>    separatedBy: [:prev :next | Transcript show: ( prev <=> next caseOf: {</div>
<div>        [-1] -> [#<]. [0] -> [#=]. [1] -> [#>]} )]</div>
<div id="x_Signature">
<div id="x_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="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_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 class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Still, the example is rather fictive ...</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Best,</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</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> Mittwoch, 14. April 2021 14:51:12<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Inbox: Collections-mt.941.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">A new version of Collections was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-mt.941.mcz">http://source.squeak.org/inbox/Collections-mt.941.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-mt.941<br>
Author: mt<br>
Time: 14 April 2021, 2:51:04.673628 pm<br>
UUID: 93df256c-2d6c-e246-87aa-4296ff9c993d<br>
Ancestors: Collections-ul.940<br>
<br>
(Not a) proposal. In #do:separatedBy: optionally provide the elements around that separation to the block. Looks like an interleaved combination of #do: and #overlappingPairsDo:.<br>
<br>
Here is a (not convincing) example:<br>
<br>
(1 to: 20)<br>
        do: [:num | Transcript showln: num]<br>
        separatedBy: [:a :b | Transcript showln: a+b]<br>
        <br>
Maybe this is something. Haven't found a good example yet.<br>
<br>
=============== Diff against Collections-ul.940 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Collection>>do:separatedBy: (in category 'enumerating') -----<br>
  do: elementBlock separatedBy: separatorBlock<br>
         "Evaluate the elementBlock for all elements in the receiver,<br>
         and evaluate the separatorBlock between."<br>
  <br>
+        | beforeFirst lastSeen | <br>
-        | beforeFirst | <br>
         beforeFirst := true.<br>
         self do:<br>
                 [:each |<br>
                 beforeFirst<br>
                         ifTrue: [beforeFirst := false]<br>
+                        ifFalse: [separatorBlock cull: lastSeen cull: each].<br>
+                elementBlock value: each.<br>
+                lastSeen := each]!<br>
-                        ifFalse: [separatorBlock value].<br>
-                elementBlock value: each]!<br>
<br>
Item was changed:<br>
  ----- Method: SequenceableCollection>>do:separatedBy: (in category 'enumerating') -----<br>
  do: elementBlock separatedBy: separatorBlock<br>
         "Evaluate the elementBlock for all elements in the receiver,<br>
         and evaluate the separatorBlock between."<br>
  <br>
+        | lastSeen |<br>
         1 to: self size do:<br>
                 [:index |<br>
+                index = 1 ifFalse: [separatorBlock cull: lastSeen cull: (self at: index)].<br>
+                lastSeen := self at: index.<br>
+                elementBlock value: lastSeen]!<br>
-                index = 1 ifFalse: [separatorBlock value].<br>
-                elementBlock value: (self at: index)]!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>