[Issue 13936] groupBy must be redone

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jan 14 13:02:49 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13936

--- Comment #36 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to hsteoh from comment #35)
> My impression was that you wanted to take this over because you were less
> than impressed with my implementation of groupBy? Or did I misunderstand
> your intentions?

Oh, sorry I misunderstood. 

I appreciate your work, and I'm not saying this perfunctorily; this important
facility has been missing for years until you brought it about, and from a
working implementation no less. To put this into perspective, the existing
groups() completely sucks.

That said the long and short of it is it's obvious to me that
http://dpaste.dzfl.pl/93a13ee08cc1 is the right design; I don't see how the
extant implementation or the variants discussed herein have any notable
advantage over it, but they do have a bunch of disadvantages.

I was hoping I'd convince you to take it to implementation for forward (and
better) ranges whilst keeping your implementation for input ranges. There's
also the matter of groupByAdjacent. Please advise, thanks.

--


More information about the Digitalmars-d-bugs mailing list