The recipe for memoizing a recursive function is:
(defn fib [x] ...)
(def fib (memoize fib))

I want to do something like this for local functions, because I want
to make a function that *produces* memoized functions (that way I can
have a bunch of similar functions with their own memoized cache).  So
I need to create the memoized function locally and return it.

But I can't think of any way to do this without letrec.

Any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to