Categories
Clojure coding Lisp

Anonymous (lambda) functions in Clojure

I am learning a bit of Clojure from time to time, and today I learned about shorthand notation for anonymous functions:


> (apply (fn [x y] (+ x y)) '(1 1))
2

Which is equivalent to:


> (apply #(+ %1 %2) '(1 1))
2

Leave a Reply

Your email address will not be published. Required fields are marked *