Tools to inspect and compare Clojure versions.
Tools to inspect and compare Clojure versions.
(->printable-clojure-version {:keys [major minor incremental qualifier interim]
:as _version})
Returns clojure version as a printable string.
For example:
(->printable-clojure-version {:major 1 :minor 12 :incremental 0 :qualifier nil}) ; => "1.12.0"
(->printable-clojure-version {:major 1 :minor 12 :incremental 0 :qualifier "alpha"}) ; => "1.12.0-alpha"
(->printable-clojure-version {:major 1 :minor 12 :incremental 0 :qualifier "alpha" :interim 1}) ; => "1.12.0-alpha-SNAPSHOT"
Returns clojure version as a printable string. For example: ```clj (->printable-clojure-version {:major 1 :minor 12 :incremental 0 :qualifier nil}) ; => "1.12.0" (->printable-clojure-version {:major 1 :minor 12 :incremental 0 :qualifier "alpha"}) ; => "1.12.0-alpha" (->printable-clojure-version {:major 1 :minor 12 :incremental 0 :qualifier "alpha" :interim 1}) ; => "1.12.0-alpha-SNAPSHOT" ```
(assert-minimum-clojure-version! {:keys [major minor incremental qualifier]
:as min-version})
Assert that the current version of Clojure is at least min-version
.
If the versions are incompatible, it throws an assertion error with a message indicating the incompatibility.
If the versions are, or may be compatible, it returns a keyword indicating the compatibility level:
:safe
- The Semantic Versions of the current and minimum versions are compatible.:warn
- The Semantic Versions of the current and minimum versions may be incompatible.
For example, a major version bump in the language version may introduce breaking changes in the API.
However, the current version may still be compatible with the minimum version.min-version
should be a map with the same structure as the dynamic var clojure-version
.
For example, the dependency [org.clojure/clojure "1.12.0"]
would translate to:
*clojure-version*
; => {:major 1, :minor 12, :incremental 0, :qualifier nil}
This function is useful for libraries that require a minimum version of Clojure to function properly.
Assert that the current version of Clojure is at least `min-version`. If the versions are incompatible, it throws an assertion error with a message indicating the incompatibility. If the versions are, or may be compatible, it returns a keyword indicating the compatibility level: - `:safe` - The Semantic Versions of the current and minimum versions are compatible. - `:warn` - The Semantic Versions of the current and minimum versions may be incompatible. For example, a major version bump in the language version may introduce breaking changes in the API. However, the current version may still be compatible with the minimum version. `min-version` should be a map with the same structure as the dynamic var `clojure-version`. For example, the dependency `[org.clojure/clojure "1.12.0"]` would translate to: ```clj *clojure-version* ; => {:major 1, :minor 12, :incremental 0, :qualifier nil} ``` This function is useful for libraries that require a minimum version of Clojure to function properly.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close