(lu-cache-factory base & {threshold :threshold, :or {threshold 32}})
Returns an LU cache with the cache and usage-table initialied to `base`.
This function takes an optional `:threshold` argument that defines the maximum number
of elements in the cache before the LU semantics apply (default is 32).
Source
(defn lu-cache-factory
"Returns an LU cache with the cache and usage-table initialied to `base`.
This function takes an optional `:threshold` argument that defines the maximum number
of elements in the cache before the LU semantics apply (default is 32)."
[base & {threshold :threshold :or {threshold 32}}]
{:pre [(number? threshold) (< 0 threshold)
(map? base)]}
(clojure.core.cache/seed (LUCache. {} (clojure.data.priority-map/priority-map) threshold) base))