core.memoize is a new Clojure contrib library providing the following features:
An underlying PluggableMemoization
protocol that
allows the use of customizable and swappable memoization caches that
adhere to the synchronous CacheProtocol
found in core.cache
Memoization builders for implementations of common caching strategies, including:
memo-fifo
)memo-lru
)memo-lu
)memo-ttl
)memo
) that duplicates the functionality of
Clojure’s memoize
functionFunctions for manipulating the memoization cache of
core.memoize
backed functions
core.memoize is based on a library named Unk, found at http://github.com/fogus/unk that is planned for deprecation.
You can use core.memoize in your Leiningen and Cake projects with the
following :dependencies
directive in your
project.clj
file:
[org.clojure/core.memoize "0.5.1"]
For Maven-driven projects, use the following slice of XML in your
pom.xml
’s <dependencies>
section:
<dependency>
<groupId>org.clojure</groupId>
<artifactId>core.memoize</artifactId>
<version>0.5.1</version>
</dependency>
Enjoy!
The v0.5.1 version of core.memoize is based almost wholly on the final version of Unk, with the following changes:
SoftCache
backed implementation was buggy and
removed for nowThe following capabilities are under design, development, or consideration for future versions of core.memoize:
More planning is needed around capabilities not listed nor thought of.
:F