On 1/23/15 7:30 PM, bearophile wrote:
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
All languages I know do this for `group by` (because of the complexity
involved), and I think it's ok to do so.