[squeak-dev] The Inbox: Collections-ct.979.mcz
Thiede, Christoph
Christoph.Thiede at student.hpi.uni-potsdam.de
Thu Jan 27 16:34:27 UTC 2022
Hi Marcel,
it's just harder to use in scripting.
Basically, I think we would need composition to integrate the progress-reporting concern into Collections. I've already tried in the past to write a proxy ProgressReadStream, but our streams do not have an execute-around semantics, making it hard to close the progress bar again ...
Best,
Christoph
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 27. Januar 2022 11:17:04
An: squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Collections-ct.979.mcz
-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/19032c05/attachment.html>
More information about the Squeak-dev
mailing list
|