[squeak-dev] The Inbox: Collections-nice.869.mcz

Jakob Reschke forums.jakob at resfarm.de
Thu Jan 2 21:08:55 UTC 2020

Am Do., 2. Jan. 2020 um 21:12 Uhr schrieb Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com>:

> If we strictly adhere to this interpretation of method comment, detectMin:
> detectMax: detect:ifNone: and count: should also iterate on each and every
> element.
> Do you agree that count: hardly benefits from such definition?

Instinctively I wanted to reply that the optimization in RunArray does not
change the result of these operations contrary to collect: because they do
not change elements, so equal elements could not suddenly become non-equal
elements during the operation. But it got me thinking that I cannot imagine
these usefully with side effects in the blocks... :-)

What about do: and inject:into: instead? Would you evaluate their blocks
only once per run?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200102/043dc2a9/attachment.html>

More information about the Squeak-dev mailing list