The Dispatch Macro
- Anonymous function literal (#())
#(…) ⇒ (fn [args] (…))
where args are determined by the presence of argument literals taking the form %, %n or %&. % is a synonym for %1, %n designates the nth arg (1-based), and %& designates a rest arg. This is not a replacement for fn - idiomatic use would be for very short one-off mapping/filter fns and the like. #() forms cannot be nested.
Nice Clojure Bridge Writeup
A Quick Example
;; Two different ways to write a function that takes two ;; arguments, stringifies them, and joins them with a space in between. ((fn [a b] (str a " " b)) "derp" 42) ;; => "derp 42" (#(str % " " %2) "derp" 42) ;; => "derp 42"