bearophile , dans le message (digitalmars.D:144543), a écrit : > Christophe: > >> 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. > > That's not the semantics of what I have proposed, I think you need to > read the bug report more carefully. Do you think that SchwartzSort > return the mapped range sorted? It returns the original range sorted > according to the position of the mapped items. The same is happening > here.
Well, I don't know all of Phobos, and I didn't check what schwartzSort was. I got confused by the fact that you wanted to avoid typing: reduce!max(map!callable(range)). That's a nice idea then. sort does not use a Schwartzian transformation, although is preferable in many cases in term of efficiency: it uses a less predicate, because it has been decided that it is what the user expects, am I right? If you want to use a Schwartian transformation, you use schwartzSort. If you want Phobos to be consistent, max should use a less predicate, and schwartzMax should use a Schwartzian transformation. Maybe it should not be consistent on that particular point. I'm just saying. -- Christophe
