[squeak-dev] The Trunk: Collections-ct.980.mcz
Marcel Taeumel
marcel.taeumel at hpi.de
Fri Jan 28 07:41:10 UTC 2022
Hi Christoph --
You can do in your personal image want you desire. ;-) Even add such extra protocols to help you in your personal scripting tasks.
For Trunk, however, you must restrain yourself a little bit more. There is a fine line between a so-called "logical implication" and what is actually required ... and what can be maintained.
> I don't think that these few convenience selectors in their own protocol actually hurt, do they?
The fact that I raised this concern and explained it to you indicates, that it does actually hurt some of us. I would advise that you remove this again and explore a little bit more what level of convenience is actually needed.
So, please remove this for now.
Best,
Marcel
Am 27.01.2022 17:37:40 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
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/20220128/21520965/attachment.html>
More information about the Squeak-dev
mailing list
|