(assoc-in! m ks v)
Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. The associative structure can have transients in it, but if any levels do not exist, non-transient hash-maps will be created.
Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. The associative structure can have transients in it, but if any levels do not exist, non-transient hash-maps will be created.
(assoc-in* m keys v)
Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. If any levels do not exist, hash-maps will be created. This implementation was adapted from clojure.core, but the behavior is more correct if keys is empty.
Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. If any levels do not exist, hash-maps will be created. This implementation was adapted from clojure.core, but the behavior is more correct if keys is empty.
(assoc-or m key val)
(assoc-or m key val & kvs)
Create mapping from each key to val in map only if existing val is nil.
Create mapping from each key to val in map only if existing val is nil.
(dissoc-in* m keys)
Dissociates a value in a nested associative structure, where ks is a sequence of keys and returns a new nested structure. If any resulting maps are empty, they will be removed from the new structure. This implementation was adapted from clojure.core.contrib, but the behavior is more correct if keys is empty.
Dissociates a value in a nested associative structure, where ks is a sequence of keys and returns a new nested structure. If any resulting maps are empty, they will be removed from the new structure. This implementation was adapted from clojure.core.contrib, but the behavior is more correct if keys is empty.
(filter-keys m pred)
Returns a map that only contains keys where (pred key) returns true.
Returns a map that only contains keys where (pred key) returns true.
(filter-keys-by-val pred m)
Returns all keys in map for which (pred value) returns true.
Returns all keys in map for which (pred value) returns true.
(index-by f coll)
Returns a map from the result of calling f on each item in coll to that item.
Returns a map from the result of calling f on each item in coll to that item.
(into-map & args)
Convert a list of heterogeneous args into a map. Args can be alternating keys and values, maps of keys to values or collections of alternating keys and values. If the first arg is a function, it will be used for merging duplicate values.
Convert a list of heterogeneous args into a map. Args can be alternating keys and values, maps of keys to values or collections of alternating keys and values. If the first arg is a function, it will be used for merging duplicate values.
(keyed vars)
(keyed key-type vars)
Create a map in which, for each symbol S in vars, (keyword S) is a key mapping to the value of S in the current scope. If passed an optional :strs or :syms first argument, use strings or symbols as the keys instead.
Create a map in which, for each symbol S in vars, (keyword S) is a key mapping to the value of S in the current scope. If passed an optional :strs or :syms first argument, use strings or symbols as the keys instead.
(map-keys m f & args)
Create a new map from m by calling function f on each key to get a new key.
Create a new map from m by calling function f on each key to get a new key.
(map-keys-and-vals m f & args)
Create a new map from m by calling function f on each key & each value to get a new key & value
Create a new map from m by calling function f on each key & each value to get a new key & value
(map-to f coll)
Returns a map from each item in coll to f applied to that item.
Returns a map from each item in coll to f applied to that item.
(map-vals m f & args)
Create a new map from m by calling function f on each value to get a new value.
Create a new map from m by calling function f on each value to get a new value.
(map-vals-with-keys m f & args)
Create a new map from m by calling function f, with two arguments (the key and value) to get a new value.
Create a new map from m by calling function f, with two arguments (the key and value) to get a new value.
(merge-in & args)
Merge multiple nested maps.
Merge multiple nested maps.
(multi-map m)
Takes a map with keys and values that can be sets or individual objects and returns a map from objects to sets. Used to create associations between two sets of objects.
Takes a map with keys and values that can be sets or individual objects and returns a map from objects to sets. Used to create associations between two sets of objects.
(ordering-map key-order)
(ordering-map key-order default-comparator)
Create an empty map with a custom comparator that puts the given keys first, in the order specified. Other keys will be placed after the special keys, sorted by the default-comparator.
Create an empty map with a custom comparator that puts the given keys first, in the order specified. Other keys will be placed after the special keys, sorted by the default-comparator.
(position coll)
Returns a map from item to the position of its first occurence in coll.
Returns a map from item to the position of its first occurence in coll.
(remove-keys m pred)
Returns a map that only contains keys where (pred key) returns false.
Returns a map that only contains keys where (pred key) returns false.
(remove-keys-by-val pred m)
Returns all keys of map for which (pred value) returns false.
Returns all keys of map for which (pred value) returns false.
(remove-vals m pred)
Returns a map that only contains values where (pred value) returns false.
Returns a map that only contains values where (pred value) returns false.
(update m key f & args)
Update a value for the given key in a map where f is a function that takes the previous value and the supplied args and returns the new value. Like update-in*, unchanged values are not re-assoc'd.
Update a value for the given key in a map where f is a function that takes the previous value and the supplied args and returns the new value. Like update-in*, unchanged values are not re-assoc'd.
(update-each m keys f & args)
Update the values for each of the given keys in a map where f is a function that takes each previous value and the supplied args and returns a new value. Like update-in*, unchanged values are not re-assoc'd.
Update the values for each of the given keys in a map where f is a function that takes each previous value and the supplied args and returns a new value. Like update-in*, unchanged values are not re-assoc'd.
(update-in! m [k & ks] f & args)
'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. The associative structure can have transients in it, but if any levels do not exist, non-transient hash-maps will be created.
'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. The associative structure can have transients in it, but if any levels do not exist, non-transient hash-maps will be created.
(update-in* m keys f & args)
Updates a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created. This implementation was adapted from clojure.core, but the behavior is more correct if keys is empty and unchanged values are not re-assoc'd.
Updates a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created. This implementation was adapted from clojure.core, but the behavior is more correct if keys is empty and unchanged values are not re-assoc'd.
(update-within m keyseq f & args)
Like update-in*, but don't call f at all unless the map contains something at the given keyseq.
Like update-in*, but don't call f at all unless the map contains something at the given keyseq.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close