I personally don't think I'd use the functions that return more than
one min/max. I think in such contexts, I'm usually more interested in
just sorting the whole collection. So I'd be happy just with the ones
that return one result.
--~--~-~--~~~---~--~~
You rece
Chouser asked me Saturday night if it would be possible to reduce the
number of functions in the module. I looked at the problem, and if we
want to keep the two sets of functions (returning one element and
returning many elements), idiomatically, it seems like all the
functions will have to stay:
I've worked on the library today, and imported it into a GitHub
project: http://github.com/gnuvince/clojure-greatest-least/tree/master
I've added a variation of all four functions that returns all the
greatest/least elements as well as a small test suite.
Could this be an interesting addition to
I support something like this. Also maybe see my "maximal-elements"
here:
http://groups.google.com/group/clojure/browse_thread/thread/134642cc76de17f7?hl=en#
A nice feature of getting all the maximal elements is you can do
(first (maximal-elements ...)) to recreate functions like yours but
also
A couple months ago, there was a discussion in this group about the
functions max and min and making them work with data types other than
numbers. I was toying around tonight, and I wrote the following
functions.
(defn- boundary
[compare-fn f & args]
(reduce (fn [a b] (if (compare-fn (compar