Fixed Order Sorting in Clojure
Here’s another tidy bit of Clojure that makes me happy… Of course it’s easy to sort items in the natural order: (sort [1 3 4 2]) ; => (1 2 3 4) Or via a mapping to elements that sort in a natural order: (sort-by count ["xx" "xxx" "x"]) ; => ("x" "xx" "xxx") But how do we sort in a user-defined, fixed order?
