Memoization library with many features.
Memoization library with many features.
(as-map f)
Return a map representation of the memoized entries on this function.
Return a map representation of the memoized entries on this function.
(memo fn-or-var)
(memo spec fn-or-var)
Attach a cache to a function or a var. If var is specified, then var root binding is modified with the cached version of the value.
If spec is a map, then we merge:
This is used to create the cache.
If :memento.core/region is set the a regional cache is created.
If spec is not a map, it's equivalent to {:memento.core/region spec}
Attach a cache to a function or a var. If var is specified, then var root binding is modified with the cached version of the value. If spec is a map, then we merge: - fn meta - var meta (if applicable) - the map given (with all non-namespaced keys getting memento.core namespace) This is used to create the cache. If :memento.core/region is set the a regional cache is created. If spec is not a map, it's equivalent to {:memento.core/region spec}
(memo-add! f m)
Add map's entries to the cache. The keys are argument-lists.
Returns Cache, if one was present on the function.
Add map's entries to the cache. The keys are argument-lists. Returns Cache, if one was present on the function.
(memo-clear! f)
(memo-clear! f & fargs)
Invalidate one or all entries on the memoized function.
Returns Cache, if one was present on the function.
Invalidate one or all entries on the memoized function. Returns Cache, if one was present on the function.
(memo-clear-region! region-id)
Invalidate entries in a cache region.
If only region-id is supplied the whole cache region is cleared, otherwise the specified entry (function and args).
The function used here needs to version.
Invalidate entries in a cache region. If only region-id is supplied the whole cache region is cleared, otherwise the specified entry (function and args). The function used here needs to version.
(memo-unwrap f)
Takes a function and returns uncached function.
Takes a function and returns uncached function.
(memoized? f)
Returns true if function is memoized.
Returns true if function is memoized.
(non-cached v)
Create a cache result that will not be cached.
Create a cache result that will not be cached.
(region-as-map region-id)
Return a map of memoized entries of the Cache Region.
Return a map of memoized entries of the Cache Region.
(set-region! region-id spec)
Create a new Cache Region and bind it to region-id.
It will overwrite existing region (generally dropping that cache).
Create a new Cache Region and bind it to region-id. It will overwrite existing region (generally dropping that cache).
(with-region region-id reg-desc & forms)
Run forms with region-id bound to a new region (thread-local).
Run forms with region-id bound to a new region (thread-local).
(with-region-alias region-alias region-id & forms)
Run forms with region-alias aliasing the existing region region-id (thread-local).
Run forms with region-alias aliasing the existing region region-id (thread-local).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close