You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2023/12/18 11:09:00 UTC
[jira] [Updated] (GROOVY-11253) Identity variants for DGM#countBy
[ https://issues.apache.org/jira/browse/GROOVY-11253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King updated GROOVY-11253:
-------------------------------
Description:
We haven't added such functionality in the past since it was thought to be more of a niche use case than groupBy (where we do provide it). But given this is the closest Groovy has to creating a multiset/bag, it is probably worth having as a shortcut - rather than requiring an explicit Closure.IDENTITY.
Whether Groovy should have specialised multiset and multimap classes is another question for another issue. We could use ".toMultiset()" to return a more specialised multiset return type in that case, so we aren't making it harder with this PR to add such functionality later if we wanted.
> Identity variants for DGM#countBy
> ---------------------------------
>
> Key: GROOVY-11253
> URL: https://issues.apache.org/jira/browse/GROOVY-11253
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Priority: Major
>
> We haven't added such functionality in the past since it was thought to be more of a niche use case than groupBy (where we do provide it). But given this is the closest Groovy has to creating a multiset/bag, it is probably worth having as a shortcut - rather than requiring an explicit Closure.IDENTITY.
> Whether Groovy should have specialised multiset and multimap classes is another question for another issue. We could use ".toMultiset()" to return a more specialised multiset return type in that case, so we aren't making it harder with this PR to add such functionality later if we wanted.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)