http://d.puremagic.com/issues/show_bug.cgi?id=4705
Denis Derman <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Denis Derman <[email protected]> 2010-12-24 11:12:14 PST --- (In reply to comment #0) > I also suggest to create two new functions, that I have just called maxs() and > mins() similar to max and min, that find all the max or min items of a given > collection. They don't need the case with two or three items: > > maxs(collection) > maxs!(callable)(collection) > > mins(collection) > mins!(callable)(collection) Why I understand the utility of maxs/mins, I wonder about them in std lib. Aren't they "niche domain" tools? Also, I wonder about maxs(collection) without any trnasform func: if you don't map, then there is logically a single max value (even if can occur several times in collection). maxS/minS seems useful only in presence of a transform func on which results comparison is done: the compared value is (in your case string len) unique, but there may be several original values in coll that map to it. To say it deifferently, in your case mins(collection) would return possibly multiple specimens of the same string. And mins(lenghts) would return [5,5]. Unless I misunderstand your point. Denis -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
