[squeak-dev] The Inbox: Collections-ct.979.mcz
Marcel Taeumel
marcel.taeumel at hpi.de
Thu Jan 27 10:17:04 UTC 2022
-1 Next thing would be #reject: then ... then .. ;-)
I think that the alternative is okay-ish:
Array streamContents: [:s |
(1 to: 5000) do: [:i | s nextPut: i factorial] displayingProgress: [:i | ...]].
Best,
Marcel
Am 26.01.2022 21:42:24 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.979.mcz
==================== Summary ====================
Name: Collections-ct.979
Author: ct
Time: 26 January 2022, 9:42:12.334407 pm
UUID: 3ddfcc79-b9c2-504e-bd97-f5ec888dee08
Ancestors: Collections-mt.978
Proposal: Add #collect:displayingProgress: to the enumerating protocol. Especially useful during scripting.
(1 to: 5000) asArray collect: [:i | i factorial] displayingProgress: [:i | 'Computing factorial for ' , i]
=============== Diff against Collections-mt.978 ===============
Item was added:
+ ----- Method: Collection>>collect:displayingProgress: (in category 'enumerating') -----
+ collect: aBlock displayingProgress: aStringOrBlock
+
+ | newCollection |
+ newCollection := OrderedCollection new.
+ self
+ do: [:each | newCollection add: (aBlock value: each)]
+ displayingProgress: aStringOrBlock.
+ ^ newCollection!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220127/efdbd380/attachment.html>
More information about the Squeak-dev
mailing list
|