Liking cljdoc? Tell your friends :D

ordered-collections.kernel.order


*compare*clj

source

<=clj

(<= x)
(<= x y)
(<= x y & more)
source

>=clj

(>= x)
(>= x y)
(>= x y & more)
source

compareclj

(compare x y)
source

compare-byclj

(compare-by pred)

Given a predicate that defines a total order over some domain, return a three-way Comparator built from it. Note: The predicate must be serializable for the comparator to be serializable.

Given a predicate that defines a total order over some domain,
return a three-way Comparator built from it.
Note: The predicate must be serializable for the comparator to be serializable.
sourceraw docstring

compare<=clj

(compare<= x y)
source

compare>clj

(compare> x y)
source

compare>=clj

(compare>= x y)
source

default-comparator?clj

(default-comparator? cmp)

Returns true if cmp is one of the built-in comparators whose ordering is equivalent to clojure.core/compare for its element type. Used to determine if a collection can safely round-trip through EDN.

Returns true if cmp is one of the built-in comparators whose ordering
is equivalent to clojure.core/compare for its element type.
Used to determine if a collection can safely round-trip through EDN.
sourceraw docstring

double-compareclj

Specialized comparator for Double keys.

Specialized comparator for Double keys.
sourceraw docstring

general-compareclj

General-purpose comparator that provides a deterministic total order over all values, including types that clojure.core/compare does not order (such as Namespace and Var).

For Comparable values, delegates to clojure.core/compare. For non-Comparable values, falls back to class name, then str, then hash ordering.

Use with ordered-set-with / ordered-map-with. Expect roughly 20% slower lookups compared to the default comparator on Comparable types.

General-purpose comparator that provides a deterministic total order over
all values, including types that clojure.core/compare does not order (such
as Namespace and Var).

For Comparable values, delegates to clojure.core/compare. For non-Comparable
values, falls back to class name, then str, then hash ordering.

Use with ordered-set-with / ordered-map-with. Expect roughly 20% slower
lookups compared to the default comparator on Comparable types.
sourceraw docstring

long-compareclj

Specialized comparator for Long keys. Avoids type dispatch overhead of clojure.core/compare for ~15-25% faster comparisons on numeric keys.

Specialized comparator for Long keys. Avoids type dispatch overhead of
clojure.core/compare for ~15-25% faster comparisons on numeric keys.
sourceraw docstring

maxclj

(max x & args)
source

normal-compareclj

Default comparator that delegates to clojure.core/compare. For best numeric performance, use long-ordered-set/long-ordered-map.

Default comparator that delegates to clojure.core/compare.
For best numeric performance, use long-ordered-set/long-ordered-map.
sourceraw docstring

string-compareclj

Specialized comparator for String keys. Uses String.compareTo directly.

Specialized comparator for String keys. Uses String.compareTo directly.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close