[squeak-dev] The Inbox: Collections-ct.979.mcz
tim at rowledge.org
Thu Jan 27 18:09:44 UTC 2022
Yeah, let's get really thorough and make sure we have a full suite of #select:thenDo:andThenReject:if: type methods. With some work we can exceed a 64bit memory address range...
> On 2022-01-27, at 2:17 AM, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
> -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 | ...]].
>> 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:
>> ==================== 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!
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
I majored in Art and Logic. Now I draw my own conclusions
More information about the Squeak-dev