Liking cljdoc? Tell your friends :D

memento.core

Memoization library with many features.

Memoization library with many features.
raw docstring

*default-type*clj

source

as-mapclj

(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.
sourceraw docstring

enabled?clj

source

memoclj

(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:

  • 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}

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}
sourceraw docstring

memo-add!clj

(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.
sourceraw docstring

memo-clear!clj

(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.
sourceraw docstring

memo-clear-region!clj

(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.
sourceraw docstring

memo-unwrapclj

(memo-unwrap f)

Takes a function and returns uncached function.

Takes a function and returns uncached function.
sourceraw docstring

memoized?clj

(memoized? f)

Returns true if function is memoized.

Returns true if function is memoized.
sourceraw docstring

non-cachedclj

(non-cached v)

Create a cache result that will not be cached.

Create a cache result that will not be cached.
sourceraw docstring

region-as-mapclj

(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.
sourceraw docstring

set-region!clj

(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).
sourceraw docstring

with-regioncljmacro

(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).
sourceraw docstring

with-region-aliascljmacro

(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).
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close