You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paulk-asert (via GitHub)" <gi...@apache.org> on 2025/04/09 01:29:31 UTC
[PR] GROOVY-11606: Lazy findAll, collect, collectMany [groovy]
paulk-asert opened a new pull request, #2182:
URL: https://github.com/apache/groovy/pull/2182
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11606: Lazy findAll, collect, collectMany [groovy]
Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert commented on PR #2182:
URL: https://github.com/apache/groovy/pull/2182#issuecomment-2821128192
This PR has been updated with an alternative suggestion. Instead of eager & lazy/iterator variants being:
```
List collect(Iterator)
Iterator collectLazy(Iterator)
```
They are now:
```
List collect(Iterator)
Iterator collecting(Iterator)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11606: Lazy findAll, collect, collectMany [groovy]
Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert merged PR #2182:
URL: https://github.com/apache/groovy/pull/2182
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11606: Lazy findAll, collect, collectMany [groovy]
Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert commented on PR #2182:
URL: https://github.com/apache/groovy/pull/2182#issuecomment-2799053479
The Smalltalk semantics for "collect" is transform. Think: I have an aggregate of People and I'll produce an aggregate of Names by "collect"ing each person's name. The "into a collection" is definitely true when we supply a collector but isn't a required interpretation when the incoming aggregate isn't a collection. Currently though, if the incoming aggregate is Set or array, we produce List as the output aggregate (though collectNested preserves the Set). The collect using the identity transform is a bit of an anomaly. Having some "map" variants certainly let's us not break compatibility if we don't mind the extra variants.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11606: Lazy findAll, collect, collectMany [groovy]
Posted by "eric-milles (via GitHub)" <gi...@apache.org>.
eric-milles commented on PR #2182:
URL: https://github.com/apache/groovy/pull/2182#issuecomment-2798855109
I have started to look this over. I am trying to frame up my understanding of the "collect" semantic. And since there is a simple "collect(Iterator): List" that is basically the same as "toList(Iterator)", my understanding is that "collect" gathers up elements and produces a collection. With that understanding, a "collectLazy" that produces an iterator does not fit IMO.
My initial take is that the Stream API offers all of this -- I think -- and the difference between ".collectLazy(" and ".stream().map(" is not that much in terms of character savings. Is the idea here that an iterator chain is more lightweight compared to a stream pipeline? If yes, I'm trying to frame up the possibility of adding "map", "filter" and one or more terminal operations (possibly existing) to support "aggregate.iterator().map(transform).filter(predicate).toList()" or just "iterator.map(transform).filter(predicate).toList()".
I will probably need to go through each example given in the [blog post](https://groovy.apache.org/blog/exploring-gatherers4j) to understand what is missing and what is proposed to fill the gap.
See also: https://groovy.apache.org/blog/groovy-gatherers
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11606: Lazy findAll, collect, collectMany [groovy]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2182:
URL: https://github.com/apache/groovy/pull/2182#issuecomment-2788078965
## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2182?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `84.17722%` with `25 lines` in your changes missing coverage. Please review.
> Project coverage is 68.9425%. Comparing base [(`872f16f`)](https://app.codecov.io/gh/apache/groovy/commit/872f16f48adce9e08e29a5880734dc57115fecfa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`af0551a`)](https://app.codecov.io/gh/apache/groovy/commit/af0551aca9559b4b2c9b25864ca58d687741eb43?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2182?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2182?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FDefaultGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvRGVmYXVsdEdyb292eU1ldGhvZHMuamF2YQ==) | 84.1772% | [15 Missing and 10 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2182 +/- ##
==================================================
+ Coverage 68.9192% 68.9425% +0.0233%
- Complexity 29596 29608 +12
==================================================
Files 1422 1422
Lines 113887 114037 +150
Branches 19750 19770 +20
==================================================
+ Hits 78490 78620 +130
- Misses 28777 28790 +13
- Partials 6620 6627 +7
```
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2182?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2182?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FDefaultGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvRGVmYXVsdEdyb292eU1ldGhvZHMuamF2YQ==) | `74.5470% <84.1772%> (+0.4028%)` | :arrow_up: |
... and [3 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2182/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11606: Lazy findAll, collect, collectMany [groovy]
Posted by "eric-milles (via GitHub)" <gi...@apache.org>.
eric-milles commented on PR #2182:
URL: https://github.com/apache/groovy/pull/2182#issuecomment-2798856581
I'm also trying to take in [GROOVY-11603](https://issues.apache.org/jira/browse/GROOVY-11603), which added some factory methods for an iterator. I seem to recall Stream added such things post Java 8. And I may have been expecting them as DSGM extensions rather than new `groovy.util.` classes, which are default imported.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org