Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
memoized anonymous functions in clojure
; inspired from
(defmacro memoize-fn
"Produces a memoized anonymous function that can recursively call itself."
[fn-name & fn-args]
[~fn-name (memoize
(fn ~@fn-args))]
(.bindRoot ~fn-name @~fn-name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment