(deep-merge & vals)
Recursively merges maps. If vals are not maps, the last value wins.
Recursively merges maps. If vals are not maps, the last value wins.
(do1 form-1 & other-forms)
Evaluates all the forms and returns the result of the first form.
Evaluates all the forms and returns the result of the first form.
(do2 form-1 form-2 & other-forms)
Evaluates all the forms and returns the result of the second form.
Evaluates all the forms and returns the result of the second form.
(econd & clauses)
Like cond
, except throws a RuntimeException if no clause matches.
Like `cond`, except throws a RuntimeException if no clause matches.
(indexed s)
Returns a lazy sequence of [index, item] pairs, where items come from 's' and indexes count up from zero. eg: (indexed '(a b c d)) => ([0 a] [1 b] [2 c] [3 d])
Returns a lazy sequence of [index, item] pairs, where items come from 's' and indexes count up from zero. eg: (indexed '(a b c d)) => ([0 a] [1 b] [2 c] [3 d])
(positions pred coll)
Returns a lazy sequence containing the positions at which pred is true for items in coll.
Returns a lazy sequence containing the positions at which pred is true for items in coll.
(select-keys-recursively m key-paths)
Similar to select-keys
, but with key paths digging in to a nested map.
key-paths
is a sequence. Each element of key-paths
begins with a key, k,
to be selected and is followed by a vector of key paths that specify the
things to be selected from the value corresponding to k.
Example:
(select-keys-recursively {:k-1 "v-1"
:k-2 {:k-2-1 "v-2-1"
:k-2-2 {:k-2-2-1 "v-2-2-1"
:k-2-2-2 "v-2-2-2"
:k-2-2-3 "v-2-2-3"}}
:k-3 "v-3"}
[[:k-1]
[:k-2 [:k-2-2
[:k-2-2-1]
[:k-2-2-3]]]])
=> {:k-1 "v-1"
:k-2 {:k-2-2 {:k-2-2-1 "v-2-2-1"
:k-2-2-3 "v-2-2-3"}}}
Similar to `select-keys`, but with key paths digging in to a nested map. `key-paths` is a sequence. Each element of `key-paths` begins with a key, k, to be selected and is followed by a vector of key paths that specify the things to be selected from the value corresponding to k. Example: (select-keys-recursively {:k-1 "v-1" :k-2 {:k-2-1 "v-2-1" :k-2-2 {:k-2-2-1 "v-2-2-1" :k-2-2-2 "v-2-2-2" :k-2-2-3 "v-2-2-3"}} :k-3 "v-3"} [[:k-1] [:k-2 [:k-2-2 [:k-2-2-1] [:k-2-2-3]]]]) => {:k-1 "v-1" :k-2 {:k-2-2 {:k-2-2-1 "v-2-2-1" :k-2-2-3 "v-2-2-3"}}}
(transitive-closure f v)
The set of values obtained by starting with v, then applying f to v, then applying f to each of the results, and so on. v and all intermediate values are included in the result.
The set of values obtained by starting with v, then applying f to v, then applying f to each of the results, and so on. v and all intermediate values are included in the result.
(transitive-closure-excluding-self f v)
The set of values obtained by applying f to v, then applying f to each of the results, and so on. All intermediate values are included in the result.
The set of values obtained by applying f to v, then applying f to each of the results, and so on. All intermediate values are included in the result.
(unchunk s)
Produce a fully-lazy sequence from s
.
Sometimes Clojure sequences are not fully lazy.
See http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/
for details.
See also Stuart Sierra comment at https://stackoverflow.com/questions/3407876/how-do-i-avoid-clojures-chunking-behavior-for-lazy-seqs-that-i-want-to-short-ci
Produce a fully-lazy sequence from `s`. Sometimes Clojure sequences are not fully lazy. See http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/ for details. See also Stuart Sierra comment at https://stackoverflow.com/questions/3407876/how-do-i-avoid-clojures-chunking-behavior-for-lazy-seqs-that-i-want-to-short-ci
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close