RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

Viktor Klang vklang at openjdk.org
Thu Nov 9 10:09:12 UTC 2023


On Thu, 9 Nov 2023 09:40:34 GMT, Tagir F. Valeev <tvaleev at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/stream/Gatherers.java line 426:
>> 
>>> 424:      * transformation for scenarios where no combiner-function can be
>>> 425:      * implemented, or for reductions which are intrinsically
>>> 426:      * order-dependent.
>> 
>> I think, we should highlight the most important difference between `fold` and `reduce`: `reduce` must provide an associative function, while `fold` does not require this restriction.
>
> Please take a look here, probably this comment was overlooked?

Yeah, I was thinking about that. I tried to word it will "less jargon" so it is easier to casually read and understand.
I'm wondering if adding "associativity" helps in that regard? 🤔

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1387773098


More information about the core-libs-dev mailing list