1.2.0 permalink Arrow_down_16x16
  • (map-values f hash)
Like map, but works over the values of a hash map

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/datalog/util.clj:41 top

(defn map-values
  "Like map, but works over the values of a hash map"
  [f hash]
  (let [key-vals (map (fn [[key val]] [key (f val)]) hash)]
    (if (seq key-vals)
      (apply conj (empty hash) key-vals)
      hash)))
Vars in clojure.contrib.datalog.util/map-values: apply conj defn empty hash let seq
Used in 0 other vars

Comments top

No comments for map-values. Log in to add a comment.