What is the name of the construct in clojure that uses # at the begining of the expression a % in the middle? For example
#(fn [a b] (% b a))
I’ve tried searching the documentation for it but as both characters that define it aren’t alphanumeric my search hasn’t been too successful.
It is a reader macro for the anonymous function declaration. See http://clojure.org/reader for a comprehensive list of reader macros.
For instance,
#(* 5 %)translates to(fn [x] (* 5 x)).Your example translates in reading phase to
(fn [op] (fn [a b] (op a b)))(opis my choice of placeholder there.)