I'm getting my feet wet with Clojure the past couple of day and came across this piece of code:
(defn reduce-example
[new-map [key val]]
(assoc new-map key (inc val)))
(reduce reduce-example
{}
{:max 30 :min 10})
; => {:max 31, :min 11}
I am confused about the function argument in reduce-example, more specifically this: new-map [key value]
From what I studied so far and after the function name, you can declare the number of arguments (arities). For example [x y z], but what does [new-map [key value]] mean? of course it can extract the key and value but how? how should I interpret this function argument?
Thank you