[WORK] groupBy is in! Next: aggregate

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 24 22:28:06 PST 2015


On Sun, Jan 25, 2015 at 01:39:59AM -0300, Ary Borenszweig via Digitalmars-d wrote:
> On 1/23/15 8:54 PM, Andrei Alexandrescu wrote:
> >On 1/23/15 1:36 PM, H. S. Teoh via Digitalmars-d wrote:
> >>On Fri, Jan 23, 2015 at 08:44:05PM +0000, via Digitalmars-d wrote:
> >>[...]
> >>>You are talking about two different functions here. group by and
> >>>partition by. The function that has been implemented is often
> >>>called partition by.
> >>[...]
> >>
> >>It's not too late to rename it, since we haven't released it yet. We
> >>still have a little window of time to make this change if necessary.
> >>Andrei?
> >>
> >>Returning each group as a tuple sounds like a distinct, albeit
> >>related, function. It can probably be added separately.
> >
> >We already have partition() functions that actually partition a range
> >into two subranges, so adding partitionBy with a different meaning
> >may be confusing. -- Andrei
> 
> Another name might be chunkBy: it returns chunks that are grouped by
> some logic.

Incidentally, that was the original name I implemented it under.


T

-- 
What do you get if you drop a piano down a mineshaft? A flat minor.


More information about the Digitalmars-d mailing list