Possible additional DGM collectEntries variants

2022-12-19 Thread Paul King
Hi folks, @mrhaki who many of you may know as the author of "Groovy Goodness" also covers other topics and recently covered Kotlin's associate method: https://blog.jdriven.com/2022/12/kotlin-kandy-transform-items-in-a-collection-to-a-map-with-associate/ Groovy addresses this use case fairly well

Re: Possible additional DGM collectEntries variants

2022-12-19 Thread Daniel Sun
+1 Cheers, Daniel Sun On 2022/12/19 11:23:19 Paul King wrote: > Hi folks, > > @mrhaki who many of you may know as the author of "Groovy Goodness" also > covers other topics and recently covered Kotlin's associate method: > > https://blog.jdriven.com/2022/12/kotlin-kandy-transform-items-in-a-col

RE: [EXT] Possible additional DGM collectEntries variants

2022-12-19 Thread Milles, Eric (TR Technology) via dev
True, no direct equivalents for associateBy and associateWithValue. But "collectEntries{ [it.toLowerCase(), it] }" is pretty succinct. If you wanted to extend with just one new extension of collectEntries, I think ".collectEntries(keyFun, Function.identity())" and ".collectEntries(Function.ide