[CMEMOIZE-8] memoizing functions that throw exceptions Created: 09/Jul/13 Updated: 02/Jan/14
core.memoize doesn't retry if the orginal function throws an exception.
(defn print-and-throw 
(def normal (memoize print-and-throw))
|Comment by Martin Trojer [ 25/Jul/13 10:31 AM ]|
This is caused by the following bug in delay;
core.memoize probably shouldn't use delays, maybe revert to using atoms like (memoize).
The proposed solution in
|Comment by Fogus [ 13/Aug/13 8:22 AM ]|
Version 0.5.7-SNAPSHOT has a potential fix in place. If you're so inclined to try it out I would appreciate any feedback that you have.
|Comment by Jozef Wagner [ 02/Jan/14 4:46 PM ]|
d-lay has an unsynchronized deref, which introduces a race condition between @memory and swap!. Moreover, memory seems to store only one element, so no map is needed there. I suggest something like: