(for-map seq-exprs key-expr val-expr)
(for-map m-sym seq-exprs key-expr val-expr)
(for-map &form &env seq-exprs key-expr val-expr)
(for-map &form &env m-sym seq-exprs key-expr val-expr)
Like 'for' for building maps. Same bindings except the body should have a key-expression and value-expression. If a key is repeated, the last value (according to "for" semantics) will be retained. (= (for-map [i (range 2) j (range 2)] [i j] (even? (+ i j))) {[0 0] true, [0 1] false, [1 0] false, [1 1] true}) An optional symbol can be passed as a first argument, which will be bound to the transient map containing the entries produced so far.
Like 'for' for building maps. Same bindings except the body should have a key-expression and value-expression. If a key is repeated, the last value (according to "for" semantics) will be retained. (= (for-map [i (range 2) j (range 2)] [i j] (even? (+ i j))) {[0 0] true, [0 1] false, [1 0] false, [1 1] true}) An optional symbol can be passed as a first argument, which will be bound to the transient map containing the entries produced so far.
(map-vals f m)
Build map k -> (f v) for [k v] in map, preserving the initial type
Build map k -> (f v) for [k v] in map, preserving the initial type
(merge-aliases objects aliases)
Create objects named as aliases, copied from object definitions that they alias
Create objects named as aliases, copied from object definitions that they alias
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close