[Issue 13936] groupBy must be redone

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 8 16:42:50 PST 2015


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

--- Comment #10 from Andrei Alexandrescu <andrei at erdani.com> ---
I'd say we reached the point where some code would help a lot more than
additional discourse. A few thoughts:

1. I think we shouldn't care about non-equivalence relations. Most tasks people
do are relational-inspired operations using equivalence relations. All APIs I
know of only support equivalence relations. It would take a lot of evidence to
default the other way. For the time being I am explicitly opposed to supporting
non-relational predicates if that complicates anything in any way.

2. Yes I am thinking reference counting would be do the trick. One allocation
and deallocation per big range use should be amortized nicely.

3. I am somewhat immune to arguments based on "it's complicated" or "it runs
into compiler bugs". Sorry. It seems to me this is exactly the kinds of stuff
we need to explore more.

4. Random-access ranges should be a lot easier to handle, so I guess a
specialization would be in order.

5. I need to think about .save on the outer range, thanks.

Overall I think we shouldn't continue to find reasons for which it can't be
done, but instead explore and see how it can be done. As of now I consider
groupBy in it current form unacceptable and a blocker for the next release.

--


More information about the Digitalmars-d-bugs mailing list