Parse and compare generic version strings.
Does not assume any versioning scheme such as Semantic Versioning, but simply interprets sequences of digits and sequences of letters as parts, ignoring punctuation and whitespace.
Compares parts lexicographically, filling shorter versions with nil
.
Types are compared as int > nil > string
. That means that 2.1.0
is
greater than 2.1
, and 2.1
is greater than 2.1-alpha2
.
Parse and compare generic version strings. Does not assume any versioning scheme such as Semantic Versioning, but simply interprets sequences of digits and sequences of letters as parts, ignoring punctuation and whitespace. Compares parts lexicographically, filling shorter versions with `nil`. Types are compared as `int > nil > string`. That means that `2.1.0` is greater than `2.1`, and `2.1` is greater than `2.1-alpha2`.
(earlier? x)
(earlier? x y)
(earlier? x y & more)
Returns true if x
is earlier than y
, false otherwise.
Returns true if `x` is earlier than `y`, false otherwise.
(later? x)
(later? x y)
(later? x y & more)
Returns true if x
is later than y
, false otherwise.
Returns true if `x` is later than `y`, false otherwise.
(latest coll)
Returns the latest version in coll
.
Returns the latest version in `coll`.
(version-compare x y)
Coerces and compares two versions x
and y
.
Coerces and compares two versions `x` and `y`.
(version-sort coll)
Sort a collection of versions.
Sort a collection of versions.
(version? x)
Returns true if x
is an instance of Version
.
Returns true if `x` is an instance of `Version`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close