Re: Simple FIFO cache for memoize

2013-01-23 Thread Michael Fogus
Absolutely essential reading. On Wed, Jan 23, 2013 at 6:02 AM, Christophe Grand wrote: > and kotka.de/blog/2010/03/memoize_done_right.html has some intersting > discussion on memoization > > > On Wed, Jan 23, 2013 at 9:12 AM, Baishampayan Ghose > wrote: >> >> Take a look at core.cache - https://

Re: Simple FIFO cache for memoize

2013-01-23 Thread Michael Fogus
> now I'm confused, which one is the right memoize to use? I'm not sure exactly what you mean, but if you mean which backing cache to use the answer depends on your needs. The core.cache wiki has discussion about the advantages/disadvantages of using one type or another. You can find the discuss

Re: Simple FIFO cache for memoize

2013-01-23 Thread AtKaaZ
now I'm confused, which one is the right memoize to use? and is that true about dosync? "the nesting property of dosync: a nested transaction merges with the surrounding one." or did it change in the past almost 3 years since? On Wed, Jan 23, 2013 at 12:08 PM, David Powell wrote: > > Specificall

Re: Simple FIFO cache for memoize

2013-01-23 Thread David Powell
Specifically, core.memoize uses core.cache to provide more flexible replacements for memoize: https://github.com/clojure/core.memoize -- Dave On Wed, Jan 23, 2013 at 8:12 AM, Baishampayan Ghose wrote: > Take a look at core.cache - https://github.com/clojure/core.cache ~BG > > On Wed, Jan 23,

Re: Simple FIFO cache for memoize

2013-01-23 Thread Christophe Grand
and kotka.de/blog/2010/03/memoize_done_right.html has some intersting discussion on memoization On Wed, Jan 23, 2013 at 9:12 AM, Baishampayan Ghose wrote: > Take a look at core.cache - https://github.com/clojure/core.cache ~BG > > On Wed, Jan 23, 2013 at 1:11 PM, Omer Iqbal wrote: > > I've been

Re: Simple FIFO cache for memoize

2013-01-23 Thread Baishampayan Ghose
Take a look at core.cache - https://github.com/clojure/core.cache ~BG On Wed, Jan 23, 2013 at 1:11 PM, Omer Iqbal wrote: > I've been reading a bit about the STM, and here's an implementation of a > FIFO cache for producing a memoized version of a function. Is it correct to > use the STM in this c

Simple FIFO cache for memoize

2013-01-22 Thread Omer Iqbal
I've been reading a bit about the STM, and here's an implementation of a FIFO cache for producing a memoized version of a function. Is it correct to use the STM in this case, or are there any drawbacks? (defn bounded-memoize "Return a bounded memoized version of fn 'f' that caches the las