Vectors of equal length sort in a way that seems natural – by
comparing their 0th elements, then their 1st, etc., until something
This property enables a blisteringly wonderful idiom for sorting
records by multiple keys:
The sort-by-juxt idiom was described on briancarper.net, where it
was refined for Clojure 1.1 by Malcolm Sparks. Andy Fingerhut has
also written about it, thoroughly.
Such lore gives it the odor of respectability, but the sort-by-juxt
idiom takes liberties beyond the documented behavior ("contract") of
vectors. APersistentVector indulges the idiom, but the clojure.org
Data Structures page does not say how vectors should compare.
The vector specification should be bolstered with enough traits of
vectors' sorting behavior to make the sort-by-juxt idiom safe to use
wherever Clojure might be implemented.