Re: ANN: cache dot clj - caching impure functions

2010-07-13 Thread Nicolas Oury
Dear all, I had the time to clean up my code. It's quite similar to your lib but it uses google-collections and so ConcurrentHashMap instead of (atom {}), which should allow more concurrency. I am a bit annoyed with the semantic of google-collections MapMaker as it does not allow soft keys with eq

Re: ANN: cache dot clj - caching impure functions

2010-07-03 Thread Nicolas Oury
Great. That will be nice to follow the same interface as you do. Will do that during this week. Best, Nicolas. On Sat, Jul 3, 2010 at 1:53 PM, Saul Hazledine wrote: > On Jul 3, 10:41 am, Nicolas Oury wrote: > > I have a - very simple - memoizer that uses Weak/Soft/Hard Hash tables > from >

Re: ANN: cache dot clj - caching impure functions

2010-07-03 Thread Saul Hazledine
On Jul 3, 10:41 am, Nicolas Oury wrote: > I have a - very simple - memoizer that uses Weak/Soft/Hard Hash tables from > the JDK or from google collections. > (Google collections has different strategies for expiration of cache. Soft > is the last time since used strategy. Weak is > a good strategy

Re: ANN: cache dot clj - caching impure functions

2010-07-03 Thread Nicolas Oury
I have a - very simple - memoizer that uses Weak/Soft/Hard Hash tables from the JDK or from google collections. (Google collections has different strategies for expiration of cache. Soft is the last time since used strategy. Weak is a good strategy for object for which identity is equality.) It is

ANN: cache dot clj - caching impure functions

2010-07-03 Thread Saul Hazledine
cache-dot-clj Clojure library that caches the results of impure functions. It is almost entirely based on the memoize functions described here: http://kotka.de/blog/2010/03/memoize_done_right.html I have found this useful for caching the results of database calls and for holding HTML snippets.