ClojureDocs

Nav

Namespaces

compare

clojure.core

Available since 1.0 (source)
  • (compare x y)
Comparator. Returns a negative number, zero, or a positive number
when x is logically 'less than', 'equal to', or 'greater than'
y. Same as Java x.compareTo(y) except it also works for nil, and
compares numbers and collections in a type-independent manner. x
must implement Comparable