(case-test-form form)
Converts all form
into a form suitable for use as a case
test. Assumes form
is already a literal value.
Converts all `form` into a form suitable for use as a `case` test. Assumes `form` is already a literal value.
(cljs-env? env)
true if compiling ClojureScript or in a ClojureScript setting, false otherwise.
true if compiling ClojureScript or in a ClojureScript setting, false otherwise.
(coll-zip root)
Return a zipper with a branch? fn of coll?.
Return a zipper with a branch? fn of coll?.
(k-combinations coll k)
All the ways to choose k items from coll.
All the ways to choose k items from coll.
(parse-int s)
Parse the string s as an integer.
Parse the string s as an integer.
(partitions n coll)
(partitions n m coll)
Examples:
(def coll [:a :b])
(partitions 0 coll)) ;; => ([])
(partitions 1 coll) ;; => ([[:a :b]])
(partitions 2 coll) ;; => '([[] [:a :b]] ;; [[:a] [:b]] ;; [[:a :b] []])
(partitions 3 coll) ;; => '([[] [] [:a :b]] ;; [[] [:a] [:b]] ;; [[:a] [] [:b]] ;; [[] [:a :b] []] ;; [[:a] [:b] []] ;; [[:a :b] [] []])
Examples: (def coll [:a :b]) (partitions 0 coll)) ;; => ([]) (partitions 1 coll) ;; => ([[:a :b]]) (partitions 2 coll) ;; => '([[] [:a :b]] ;; [[:a] [:b]] ;; [[:a :b] []]) (partitions 3 coll) ;; => '([[] [] [:a :b]] ;; [[] [:a] [:b]] ;; [[:a] [] [:b]] ;; [[] [:a :b] []] ;; [[:a] [:b] []] ;; [[:a :b] [] []])
(permutations coll)
Return a sequence of all the ways to arrange coll.
Return a sequence of all the ways to arrange coll.
(rank xs)
Returns a sorted sequence of values in xs by frequency of occurence.
Returns a sorted sequence of values in xs by frequency of occurence.
(re-matches? re s)
Returns true if s matches the regex pattern re, false otherwise.
Returns true if s matches the regex pattern re, false otherwise.
(str-partitions n str)
Examples:
(let [str "ab" n 0] (str-partitions n str)) ;; => ([])
(let [str "ab" n 1] (partitions n coll)) ;; => (["ab"])
(let [str "ab" n 2] (partitions n coll)) ;; => ([[] ["ab"] ;; [["a"] ["b"]] ;; [["ab"] []])
(let [str "ab" n 3] (partitions n coll)) ;; => ([[] [] ["ab"]] ;; [[] ["a"] ["b"]] ;; [["a"] [] ["b"]] ;; [[] ["ab"] []] ;; [["a"] ["b"] []] ;; [["ab"] [] []])
Examples: (let [str "ab" n 0] (str-partitions n str)) ;; => ([]) (let [str "ab" n 1] (partitions n coll)) ;; => (["ab"]) (let [str "ab" n 2] (partitions n coll)) ;; => ([[] ["ab"] ;; [["a"] ["b"]] ;; [["ab"] []]) (let [str "ab" n 3] (partitions n coll)) ;; => ([[] [] ["ab"]] ;; [[] ["a"] ["b"]] ;; [["a"] [] ["b"]] ;; [[] ["ab"] []] ;; [["a"] ["b"] []] ;; [["ab"] [] []])
(vsplit-at n v)
Like clojure.core/split-at
but for vectors.
Like `clojure.core/split-at` but for vectors.
(zip-next-seq loc)
Given a clojure.zip zipper location loc return a lazy sequence of all clojure.zip/next locations from loc.
Given a clojure.zip zipper location loc return a lazy sequence of all clojure.zip/next locations from loc.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close