Fork me on GitHub
Drew Verlee00:07:37

Wouldn't reduce be more clear? (reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 1 :b 2}) I guess it's also not typical that I would want all my keys Val's updated at the same time.


I've found that the "map reformer" as we've been calling it on the podcast is the clearest.

(into {} (map (juxt key (comp inc val))) m)


Pulling it into a function (like map-vals) is an interesting abstraction


I find myself just in-lining the (into ...) as it's short enough and reads like what it does


I also agree with you @markbastian. The way they talked about it in middle school sounded like I would be doing a lot more geometry than I do now. simple_smile


but it's a cool example, nevertheless