[squeak-dev] The Trunk: Collections-ct.980.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Thu Jan 27 16:37:30 UTC 2022


Hi Marcel,


I understand that we are unlikely to reach full polymorph as long as every code needs to be duplicated. Traits for all the conveniences methods *might* be an option, but I also understand that we seem not to want to make use of Traits here. :-)


Anyway, I use #collect:thenDo: as often as #select:thenCollect: and this inconsistency/ununderstood messages were striking me repeatedly. I don't think that these few convenience selectors in their own protocol actually hurt, do they? :-) Also, converting to a collection is not always an option when performance matters.


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 27. Januar 2022 11:13:17
An: squeak-dev
Betreff: Re: [squeak-dev] The Trunk: Collections-ct.980.mcz

Hi Christoph --

I don't think that we should port all convenience methods from Collection to here. Just the core. At least, that was my thinking, when I added the "collections - enumerating" back then. I deliberately chose not to add such things to not bloat the Stream interface any further.

Best,
Marcel

Am 26.01.2022 21:46:25 schrieb commits at source.squeak.org <commits at source.squeak.org>:

Christoph Thiede uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ct.980.mcz

==================== Summary ====================

Name: Collections-ct.980
Author: ct
Time: 26 January 2022, 9:46:11.770407 pm
UUID: 465bffe2-5612-4c40-974b-33bd5ec2dbbd
Ancestors: Collections-mt.978

Improves polymorphy between Collection and Stream by adding missing convenience selectors on the latter. We already have #select:thenCollect: there, so this is just a logical complement.

=============== Diff against Collections-mt.978 ===============

Item was added:
+ ----- Method: Stream>>collect:thenDo: (in category 'collections - enumerating') -----
+ collect: collectBlock thenDo: doBlock
+
+ ^ (self collect: collectBlock) do: doBlock!

Item was added:
+ ----- Method: Stream>>collect:thenSelect: (in category 'collections - enumerating') -----
+ collect: collectBlock thenSelect: selectBlock
+
+ ^ (self collect: collectBlock) select: selectBlock!

Item was added:
+ ----- Method: Stream>>reject:thenDo: (in category 'collections - enumerating') -----
+ reject: rejectBlock thenDo: doBlock
+
+ ^ (self reject: rejectBlock) do: doBlock!

Item was added:
+ ----- Method: Stream>>select:thenDo: (in category 'collections - enumerating') -----
+ select: selectBlock thenDo: doBlock
+
+ ^ (self select: selectBlock) do: doBlock!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220127/ed4ed45c/attachment.html>


More information about the Squeak-dev mailing list