the other day I was trying to come up with an example of closure in Clojure. I came up with and example I had seen before and thought it was appropriate.
Alas, I was tol
Function that returns function i.e higher order functions are nice examples of closure.
(defn pow [n] (fn [x] (apply * (repeat n x)))) (def sq (pow 2)) (def qb (pow 3))