A collection of Clojure utilities.
Leiningen coordinate:
[com.borkdal/clojure.utils "0.1.1"]
(non-empty-string? "yes") => true
(non-empty-string? :no) => false
(non-empty-string? nil) => false
(substring? "cd" "abcdef") => true
(substring? "xxx" "abcdef") => false
(to-int "7") => 7
(not-nil? 7) => true
(not-nil? nil) => false
(spaced-str "abc" nil 7 "ghi") => "abc 7 ghi"
(when-seq-let [seq nil]
:yes) => nil
(when-seq-let [seq '()]
:yes) => nil
(when-seq-let [seq '(1 2 3)]
:yes) => :yes
(fact "one-element sequence"
(only [1]) => 1)
(fact "multi-element sequence"
(only [1 2 3]) => (throws java.lang.AssertionError))
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close