<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi, all.<div><br></div><div>Any thoughts on this matter? Here are more examples:</div><div><br></div><div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px">OrderedCollection new: 20 filledWith: [100 atRandom].</span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px">Set new: 20 filledWith: [:ea | (ea + 32) asCharacter].</span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px">Dictionary new: 20 filledWith: [:ea | ea -> (ea + 32) asCharacter].</span></span></div></div><div><br></div><div>Further reading (for related naming and concepts):</div><div><br></div><div>(all implementors of ...)</div><div>#collect:as:</div><div>#fillFrom:with:</div><div>#newFrom:</div><div>#new:withAll:</div><div><br></div><div>Best,</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 16:57:53 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of Collections was added to project The Inbox:<br>http://source.squeak.org/inbox/Collections-mt.852.mcz<br><br>==================== Summary ====================<br><br>Name: Collections-mt.852<br>Author: mt<br>Time: 6 September 2019, 4:57:45.245608 pm<br>UUID: 3582be1c-a006-ed46-a517-3d2d570db6cc<br>Ancestors: Collections-mt.851<br><br>Proposal: Initialize a new collection with a computation block without needing an existing collection to #collect: from.<br><br>OrderedCollection new: 20 filledWith: [100 atRandom].<br><br>Thanks to Christoph (ct) for the idea.<br><br>If we want this in Trunk, there will be tests. :-)<br><br>=============== Diff against Collections-mt.851 ===============<br><br>Item was added:<br>+ ----- Method: ArrayedCollection class>>new:filledWith: (in category 'instance creation') -----<br>+ new: size filledWith: aBlock<br>+      "Similar to #collect:as: and #fillFrom:with: but uses only the interval (1 to: size) to fill the collection. Different compared to #new:withAll: because aBlock can return different values for each index."<br>+ <br>+   | result |<br>+   result := self new: size.<br>+    1 to: size do: [:each | result at: each put: (aBlock cull: each)].<br>+   ^ result!<br><br>Item was added:<br>+ ----- Method: Collection class>>new:filledWith: (in category 'instance creation') -----<br>+ new: size filledWith: aBlock<br>+        "Similar to #collect:as: and #fillFrom:with: but uses only the interval (1 to: size) to fill the collection. Different compared to #new:withAll: because aBlock can return different values for each index."<br>+ <br>+   | result |<br>+   result := self new: size.<br>+    1 to: size do: [:each | result add: (aBlock cull: each)].<br>+    ^ result!<br><br><br></div></blockquote></div>