(sort coll)
(sort comp coll)
Returns a sorted sequence of the items in coll. Comp can be
boolean-valued comparison function, or a -/0/+ valued comparator.
Comp defaults to compare.
Source
(defn
sort
"Returns a sorted sequence of the items in coll. Comp can be\n boolean-valued comparison function, or a -/0/+ valued comparator.\n Comp defaults to compare."
([coll] (sort compare coll))
([comp coll]
(if
(seq coll)
(let
[a (to-array coll)]
(garray/stableSort a (fn->comparator comp))
(seq a))
())))