<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000"><div class="mb_sig"></div>
                                        
                                        <div><div>Hi, all.</div><div><br></div><div><img src="cid:3ec345f4-6947-4214-816d-ddadd8a1cca9" width="auto" style="font-size: 13.3333px"></img></div><div><br></div><div>Let me try to extract the arguments for and against Collection >> #collect:thenDo: (and similar).</div><div><br></div><div>Pro</div><div>- works with most kinds of Collection</div><div>- in the source code, one less pair of parentheses needed</div><div>- same semantics as (... collect: [...]) do: [:ea | ...] ... (because it reads almost the same)</div><div>- in the source code, the word "then" supports readability (or reading flow) a bit</div><div><br></div><div>Contra</div><div>- the current implementation creates an extra collection (-> easy to change)</div><div>- no inherent support for #collect:as: to configure the target/intermediate kind (-> maybe irrelevant?)</div><div>- having all combinations would blow up the interface: do/collect/select/reject/inject ... collect:thenInject:into:thenReject:thenDo: ... (-> big issue)</div><div><br></div><div>I think that changing the implementation of #collect:thenDo: to not behave like the "expanded version" -- (... collect: [...]) do: [:ea | ...]  -- could be quite confusing. Take the following example:</div><div><br></div><div>#(1 2 3 4) asSet</div><div>   collect: [:num | num  even]</div><div>   thenDo: [:isEven | Transcript show: isEven].</div><div><br></div><div>I think that this snippet should output "falsetrue" (or "truefalse") but not "falsetruefalsetrue" (or the other combinations). Otherwise it would be sth. like #do:afterCollectEach: ... brrrrr ... Same for a SortedCollection where the sort order depends on (or changes with) the values *after* the collect operation.</div><div><br></div><div>After reading Richard's discussion, I do still not understand, when (and how) #collect:thenDo: could be misleading. At least not the way Squeak is implementing it at the moment. It is just syntactic sugar for collect;do. We have plenty of that kind of sugar. :-)</div><div><br></div><div>Best,</div><div>Marcel</div></div><blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 11.09.2019 15:14:26 schrieb Stéphane Rollandin <lecteur@zogotounga.net>:</p><div style="font-family:Arial,Helvetica,sans-serif">Guys I don't know where you went, but the rationale for getting rid of <br>#collect:thenDo: is simply that it is syntactic sugar only (just hiding <br>two parenthesis), and that it makes it at the same time pretty much <br>useless and very much misleading depending on the receiver, as per <br>Richard's discussion.<br><br>I am not proposing implementing any new thing, just removing that method.<br><br><br>Stef<br><br></div></blockquote></div>