A namespace of stupid little helper bits including the Grimoire munge operations.
A namespace of stupid little helper bits including the Grimoire munge operations.
(clojure-version->cmp-key version-str)
Create a comparison key from a Clojure version string, as returned from function clojure.core/clojure-version. The key is a vector of integers and strings, and two such keys may be compared via clojure.core/compare to get the correct relative order of the two Clojure versions.
Makes simplifying assumption that: x.y.z-alpha<n> < x.y.z-beta<m> < x.y.z-RC<p> < x.y.z.
Note that this was not the time order of release for some 1.5.0-beta and 1.5.0-RC releases, historically, as they switched from 1.5.0-RC releases back to 1.5.0-beta, and then back to 1.5.0-RC again. Hopefully that will not happen again.
Stolen from AndyF with thanks.
Create a comparison key from a Clojure version string, as returned from function clojure.core/clojure-version. The key is a vector of integers and strings, and two such keys may be compared via clojure.core/compare to get the correct relative order of the two Clojure versions. Makes simplifying assumption that: x.y.z-alpha<n> < x.y.z-beta<m> < x.y.z-RC<p> < x.y.z. Note that this was not the time order of release for some 1.5.0-beta and 1.5.0-RC releases, historically, as they switched from 1.5.0-RC releases back to 1.5.0-beta, and then back to 1.5.0-RC again. Hopefully that will not happen again. Stolen from AndyF with thanks.
(edn-read-string-with-readers s)
Read a string with clojure.edn/read-string and additional reader functions installed.
Currently the only additional reader function is the default reader function, which will return a tuple [:cant-read <tag symbol> <raw value>].
Read a string with clojure.edn/read-string and additional reader functions installed. Currently the only additional reader function is the default reader function, which will return a tuple [:cant-read <tag symbol> <raw value>].
(munge s)
This is the munge function as used by the current version of Grimoire. Should only be applied to symbols. Namespaces, packages, groups and soforth need not be name munged.
Note that this is NOT a full isomorphism, since it lacks an escape.
This is the munge function as used by the current version of Grimoire. Should only be applied to symbols. Namespaces, packages, groups and soforth need not be name munged. Note that this is _NOT_ a full isomorphism, since it lacks an escape.
(normalize-version x)
(unmunge s)
Inverts #'munge.
Note that this is NOT a full isomorphism, since it lacks an escape.
Inverts #'munge. Note that this is _NOT_ a full isomorphism, since it lacks an escape.
(update-munge s)
This function attempts to transform the legacy munging of names into the modern munging above. Note that update-munge is not an unmunge operation.
This function attempts to transform the legacy munging of names into the modern munging above. Note that update-munge is _not_ an unmunge operation.
(url-munge s)
This is the old implementation of #'munge
It's just url-encoding augmented with a specification illegal but decoder supported mapping of . -> %2E, which is retained in the codebase for compatability reasons with the existing file store.
This is the old implementation of #'munge It's just url-encoding augmented with a specification illegal but decoder supported mapping of . -> %2E, which is retained in the codebase for compatability reasons with the existing file store.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close