This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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")))) |