[WORK] groupBy is in! Next: aggregate

Ary Borenszweig via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 24 20:39:59 PST 2015


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.


More information about the Digitalmars-d mailing list