On 09/15/2011 11:44 AM, Christophe wrote:
bearophile , dans le message (digitalmars.D:144513), a écrit :
I'd like to receive some comments from Andrei about one of the most nagging
problems I have with std.algorithm, it's not a big issue, but I bump my nose
against it few times every week:
http://d.puremagic.com/issues/show_bug.cgi?id=4705
If you have questions or doubts, feel free to ask here or in Bugzilla.
Bye,
bearophile
min and max for ranges are good things to add.
If min and max use a callable, it should be a less predicate, and
max(item1, item2) should use a predicate too. A max!callable(range) that
replaces max(map!collable(range)) is unuseful and confusing, since max
should return one of the element passed in its arguments.
mins and maxs are too specialized to be in phobos IMO.
Where do you draw the line? min and max for ranges are just reduce!min
and reduce!max. What is "unuseful and confusing" about:
max!"a.length"(range); ?
Actually, I seldom want to take the maximum/minimum _without_ mapping
the range first.