[WORK] groupBy is in! Next: aggregate

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 23 14:30:57 PST 2015


H. S. Teoh:

> What you describe could be an interesting candidate to add, 
> though. It
> could iterate over distinct values of the predicate, and 
> traverse the
> forward range (input ranges obviously can't work unless you 
> allocate,
> which makes it no longer lazy) each time. This, however, has 
> O(n*k)
> complexity where k is the number of distinct predicate values.

Let's allocate, creating an associative array inside the grouping 
function :-)

Bye,
bearophile


More information about the Digitalmars-d mailing list