Dynamic.Map

=

dynamic

Dynamic

                        (= m1 m2)
                    

checks whether two maps m1 and m2 are equal.

all?

dynamic

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.

contains?

dynamic

Dynamic

                        (contains? m k)
                    

checks whether the dynamic map m contains the key k.

create

dynamic

Dynamic

                        (create)
                    

makes a dynamic map.

empty?

dynamic

Dynamic

                        (empty? m)
                    

checks whether the map m is empty.

from-array

dynamic

Dynamic

                        (from-array a)
                    

creates a map from an array of key-value pairs a.

get

dynamic

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

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.

grow

dynamic

Dynamic

                        (grow m)
                    

grows a dynamic map.

keys

dynamic

Dynamic

                        (keys m)
                    

returns the key in the map m.

kv-reduce

dynamic

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.

len

dynamic

Dynamic

                        (len m)
                    

returns the length of the map m.

map

dynamic

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

Dynamic

                        (merge m1 m2)
                    

merges to maps m1 and m2. Values in m1 are preferred on collision.

put

dynamic

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

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.

resize

dynamic

Dynamic

                        (resize m s)
                    

resizes a dynamic map to size s.

reverse

dynamic

Dynamic

                        (reverse m)
                    

reverses the key-value pairs in the map m.

shrink

dynamic

Dynamic

                        (shrink m)
                    

shrinks dynamic map.

str

dynamic

Dynamic

                        (str m)
                    

to-array

dynamic

Dynamic

                        (to-array m)
                    

creates an array of key-value pairs from the map m.

update

dynamic

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

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).

vals

dynamic

Dynamic

                        (vals m)
                    

returns the values in the map m.