Liking cljdoc? Tell your friends :D

clj-fast.clojure.core


assoc

(assoc map key val)
(assoc map
  key val
  & kvs)

assoc[iate]. When applied to a map, returns a new map of the same (hashed/sorted) type, that contains the mapping of key(s) to val(s). When applied to a vector, returns a new vector that contains val at index. Note - index must be <= (count vector).

assoc[iate]. When applied to a map, returns a new map of the
same (hashed/sorted) type, that contains the mapping of key(s) to
val(s). When applied to a vector, returns a new vector that
contains val at index. Note - index must be <= (count vector).
raw docstring

assoc-in

(assoc-in m [k & 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. If any levels do not exist, 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.
If any levels do not exist, hash-maps will be created.
raw docstring

get

(get map key)
(get map key not-found)

Returns the value mapped to key, not-found or nil if key not present.

Returns the value mapped to key, not-found or nil if key not present.
raw docstring

get-in

(get-in m ks)
(get-in m ks not-found)

Returns the value in a nested associative structure, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied.

Returns the value in a nested associative structure,
where ks is a sequence of keys. Returns nil if the key
is not present, or the not-found value if supplied.
raw docstring

merge

(merge & maps)

Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result.

Returns a map that consists of the rest of the maps conj-ed onto
the first.  If a key occurs in more than one map, the mapping from
the latter (left-to-right) will be the mapping in the result.
raw docstring

select-keys

(select-keys map keyseq)

Returns a map containing all the values of the selected keys when a resolvable sequence is supplied, otherwise, a containing only those entries in map whose key is in keys

Returns a map containing all the values of the selected keys when a
resolvable sequence is supplied, otherwise, a containing only those
entries in map whose key is in keys
raw docstring

update-in

(update-in m 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. If any levels do not exist, 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.  If any levels do not exist, hash-maps will be
created.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close