Dynamic.Map
all?
Dynamic
(all? pred m)
checks whether all key value pairs in m
satisfy the predicate
pred
. pred
takes the pair (k v)
as its sole argument.
get
Dynamic
(get m k)
gets the value under the key k
. If k
doesn’t exist in the
map, nil
is returned.
get-with-default
Dynamic
(get-with-default m k default-value)
gets the value under the key k
. If k
doesn’t
exist in the map, the default value is returned.
kv-reduce
Dynamic
(kv-reduce f init m)
reduces the map m
using the function f
and the initial
value init
. f
takes the accumulator and the pair (k v)
as its arguments
and is expected to return a new accumulator.
map
Dynamic
(map f m)
maps the function f
over all pairs in the map m
. f
takes
the pair (k v)
as its sole argument and is expected to return a new value
under v
.
merge
Dynamic
(merge m1 m2)
merges to maps m1
and m2
. Values in m1
are preferred on
collision.
put
Dynamic
(put m k v)
adds a value v
under the key k
into the map. If k
already
exists in the map, it is updated.
remove
Dynamic
(remove m k)
removes the pair under the key k
from the map m
. If it
doesn’t exist, the map is returned unchanged.
update
Dynamic
(update m k f)
updates the value under the key k
using the function f
. If
k
doesn’t exist in the map, it is returned unchanged.
update-with-default
Dynamic
(update-with-default m k f v)
updates the value under the key k
using the
function f
. If k
doesn’t exist in the map, it is set to (f v)
.