<div dir="ltr">We have String>>#displayProgressAt:from:to:during:, which is nicely decoupled from all Collection and Stream protocols.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 27, 2022 at 10:34 AM Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>

<div id="gmail-m_-2649088562448483270divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>it's just harder to use in scripting.</p>
<p><br>
</p>
<p>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 ...</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-2649088562448483270divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank">squeak-dev-bounces@lists.squeakfoundation.org</a>> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Donnerstag, 27. Januar 2022 11:17:04<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-ct.979.mcz</font>
<div> </div>
</div>
<div>
<div id="gmail-m_-2649088562448483270__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr">
-1 Next thing would be #reject: then ... then .. ;-)
<div><br>
</div>
<div>I think that the alternative is okay-ish:</div>
<div><br>
</div>
<div>Array streamContents: [:s |</div>
<div>  (1 to: 5000) do: [:i | s nextPut: i factorial] displayingProgress: [:i | ...]].</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div></div>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
<p style="color:rgb(170,170,170);margin-top:10px">Am 26.01.2022 21:42:24 schrieb <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of Collections was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-ct.979.mcz" target="_blank">http://source.squeak.org/inbox/Collections-ct.979.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-ct.979<br>
Author: ct<br>
Time: 26 January 2022, 9:42:12.334407 pm<br>
UUID: 3ddfcc79-b9c2-504e-bd97-f5ec888dee08<br>
Ancestors: Collections-mt.978<br>
<br>
Proposal: Add #collect:displayingProgress: to the enumerating protocol. Especially useful during scripting.<br>
<br>
(1 to: 5000) asArray collect: [:i | i factorial] displayingProgress: [:i | 'Computing factorial for ' , i]<br>
<br>
=============== Diff against Collections-mt.978 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Collection>>collect:displayingProgress: (in category 'enumerating') -----<br>
+ collect: aBlock displayingProgress: aStringOrBlock<br>
+ <br>
+ | newCollection |<br>
+ newCollection := OrderedCollection new.<br>
+ self<br>
+ do: [:each | newCollection add: (aBlock value: each)]<br>
+ displayingProgress: aStringOrBlock.<br>
+ ^ newCollection!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div>

<br>
</blockquote></div>