I'm new to clojure and I'm trying to understand as much as possible but the documentations are so vague
when you have a function
(fn [_ {:keys [kind]}] kind)
my understanding is that the function takes a vector map but only wants access to a key as specified by the second param {:keys.....
correct?
Then how many parameters do I pass to this function? 1 or 2?
is it a vector? {:kind 1 :dog 2} or the vector key value (:kind {....})?
Let's give the function a name:
This is shorthand for
a function of two (positional) arguments:
_
, conventionally unused, and:kind
entry bound to localkind
;which then returns whatever is bound to
kind
.Bindings that fail return
nil
.For examples: