Skip to main content

lu

function

clojure.core.memoize/lu

(lu [f] [f base] [f tkey threshold] [f base key threshold])
Similar to the implementation of memo-lru, except that this function removes all cache values whose usage value is smallest: (require '[clojure.core.memoize :as memo]) (def id (memo/lu identity :lu/threshold 3)) (id 42) (id 42) (id 43) (id 44) (snapshot id) ;=> {[44] 44, [42] 42} The **L**east **U**sed values are cleared on cache misses.

No examples yet. Be the first to add one!