(conj-at-index v idx x)
Add element to a vector at some specific index. Only works with vectors!
Add element to a vector at some specific index. Only works with vectors!
(dedupe-by f)
(dedupe-by f coll)
Returns a lazy sequence removing consecutive duplicates in coll when passed to a function f. Returns a transducer when no collection is provided.
Returns a lazy sequence removing consecutive duplicates in coll when passed to a function f. Returns a transducer when no collection is provided.
(distinct-by f)
(distinct-by f coll)
Returns a lazy sequence of the elements of coll, removing any elements that return duplicate values when passed to a function f.
Returns a lazy sequence of the elements of coll, removing any elements that return duplicate values when passed to a function f.
(index-by f coll)
Like group by, but will keep only the last result.
Like group by, but will keep only the last result.
(index-of coll x)
Find the index of element x in coll. Return nil if element is not found.
Find the index of element x in coll. Return nil if element is not found.
(keys-set m)
Return the map keys, as a set. This also checks if the entry is a map, otherwise returns nil (instead of throw).
Return the map keys, as a set. This also checks if the entry is a map, otherwise returns nil (instead of throw).
(make-map-entry k v)
CLJC helper to create MapEntry.
CLJC helper to create MapEntry.
(map-keys f m)
Map over the given hash-map keys.
Example: (map-keys #(str/replace (name %) "_" "-") {"foo_bar" 1}) => {"foo-bar" 1}
Map over the given hash-map keys. Example: (map-keys #(str/replace (name %) "_" "-") {"foo_bar" 1}) => {"foo-bar" 1}
(map-vals f m)
Map over the given hash-map vals.
Example: (map-vals inc {:a 1 :b 2})
Map over the given hash-map vals. Example: (map-vals inc {:a 1 :b 2})
(merge-defaults m defaults)
Like merge, but only add keys that are not present in the original map.
Like merge, but only add keys that are not present in the original map.
(merge-grow)
(merge-grow a)
(merge-grow a b)
Additive merging.
When merging maps, it does a deep merge. When merging sets, makes a union of them.
When value of the right side is nil, the left side will be kept.
For the rest works as standard merge.
Additive merging. When merging maps, it does a deep merge. When merging sets, makes a union of them. When value of the right side is nil, the left side will be kept. For the rest works as standard merge.
(queue)
(queue coll)
Return a blank immutable queue or create one from coll.
Return a blank immutable queue or create one from coll.
(restore-order inputs key items)
(restore-order inputs key items default-fn)
Sorts output list to match input list order.
Sorts output list to match input list order.
(update-contained m k f)
(update-contained m k f a1)
(update-contained m k f a1 a2)
(update-contained m k f a1 a2 a3)
(update-contained m k f a1 a2 a3 & args)
Update some key when that key is present in the map.
Update some key when that key is present in the map.
(update-if m k f)
(update-if m k f a1)
(update-if m k f a1 a2)
(update-if m k f a1 a2 a3)
(update-if m k f a1 a2 a3 & args)
Update some key that key is present in the map and value is truthy.
Update some key that key is present in the map and value is truthy.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close