Skip to content

Instantly share code, notes, and snippets.

View nwallace's full-sized avatar
🍑

Nathan Wallace nwallace

🍑
View GitHub Profile
;; This is a demonstration of a question I have about Clojure
;; I want a function like `map-kv`, but I'm not aware of one that behaves this way
;; My hypothetical `map-kv` works like Underscore.js/Lodash.js `map` works
(defn classify-nums [hash-or-vector]
(map-kv (fn [key-or-index value]
(if (odd? value)
"is odd"
"is even"))))