<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        <span style="font-size: 13.3333px">I think it is better to name the kind of collection you are going to fill. </span><div style="font-size: 13.3333px"><br></div><div style="font-size: 13.3333px">For some of these examples, there are better ways such as "OrderedCollection new: 20 withAll: 0".</div><div style="font-size: 13.3333px"><br></div><div style="font-size: 13.3333px">Maybe support blocks in #new:withAll:?</div><div style="font-size: 13.3333px"><br></div><div style="font-size: 13.3333px"><b>OrderedCollection</b></div><div style="font-size: 13.3333px"><b>   new: 20</b></div><div style="font-size: 13.3333px"><b>   withAll: [:index | index atRandom]</b><br><div><br></div><div><div>Best,</div><div>Marcel</div></div></div><div class="mb_sig"></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 06.09.2019 16:04:49 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<p>> <span>Especially since #timesRepeat: does not provide the iteration number to the block.</span></p>
<p><span>But so does #timesRepeat:? I was looking for a convenient way to evaluate a block n times and store the results. There seem to be various methods which, imho, could be written simpler:</span></p>
<p><span><br>
</span></p>
<p><span><img size="389460" contenttype="image/png" id="img63366" style="max-width: 99.9%; user-select: none;" contextid="img997647" tabindex="0" src="cid:bdda9ac1-bcf8-49fe-b034-187e9e23038d"></img><br>
</span></p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Freitag, 6. September 2019 15:36:49<br>
<b>An:</b> gettimothy via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Kernel-ct.1266.mcz</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hmm... #timesCollect: seems strange. Especially since #timesRepeat: does not provide the iteration number to the block. Then, #to:collect: has a similar problem: "from x to y collect what?" The explicit from "(x to: y)" for the interval object seems more readable.
<div><br>
</div>
<div>-1  ;-)</div>
<div><br>
</div>
<div><span style="font-size: 10pt">Best,</span></div>
<div>Marcel</div>
<div class="mb_sig"></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 06.09.2019 13:16:54 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of Kernel was added to project The Inbox:<br>
http://source.squeak.org/inbox/Kernel-ct.1266.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-ct.1266<br>
Author: ct<br>
Time: 6 September 2019, 1:16:39.325698 pm<br>
UUID: a5b0464f-61cf-4749-9ad3-92e7d8c85341<br>
Ancestors: Kernel-eem.1265<br>
<br>
Add shorthands for interval collecting<br>
<br>
There are enough senders of #timesRepeat: that manually fill a collection, same goes for #to:do:<br>
<br>
=============== Diff against Kernel-eem.1265 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Integer>>timesCollect: (in category 'enumerating') -----<br>
+ timesCollect: aBlock <br>
+ <br>
+ ^ (1 to: self) collect: [:i | aBlock value]!<br>
<br>
Item was added:<br>
+ ----- Method: Number>>to:collect: (in category 'intervals') -----<br>
+ to: stop collect: aBlock <br>
+ "Evaluate aBlock for each element of the interval (self to: stop by: 1) and return the results."<br>
+ <br>
+ ^ (self to: stop) collect: aBlock!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div></blockquote></div>