Skip to content

clojure.core/sort-by

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 13 Runnable: 5
([keyfn coll] [keyfn comp coll])

Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator. Guaranteed to be stable: equal elements will not be reordered. If coll is a Java array, it will be modified. To avoid this, sort a copy of the array.

Examples

by zmila on . May have evaluation errors.
by kotarak on
by shuaybi on
by jamesqiu on . May have evaluation errors.
by Yogthos on . May have evaluation errors.
by jafingerhut on . May have evaluation errors.
by foxlog on . May have evaluation errors.
by egracer on . May have evaluation errors.
by overset on
by fdhenard on
by cgaustin on . May have evaluation errors.
by naxels on
by arcanjoaq on . May have evaluation errors.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.