Liking cljdoc? Tell your friends :D

hara.function.base.memoize


+registryclj

(+registry ??)
?? invalid arglists:
()

global registry for memoize functions

global registry for memoize functions
raw docstring

defmemoizecljmacro

(defmemoize name doc? attrs? & body)

defines a cached function

(defmemoize -dec- "decrements" {:added "1.0"} ([x] (dec x)))

(-dec- 1) => 0 @+-dec- => '{(1) 0}

defines a cached function

(defmemoize -dec-
  "decrements"
  {:added "1.0"}
  ([x] (dec x)))

(-dec- 1) => 0
@+-dec- => '{(1) 0}
raw docstring

deregister-memoizeclj

(deregister-memoize mem)
(deregister-memoize mem var registry)

deregisters the memoize function

(deregister-memoize -inc-)

deregisters the memoize function

(deregister-memoize -inc-)
raw docstring

invoke-intern-memoizeclj

(invoke-intern-memoize _ name {:keys [function cache] :as config} body)

creates a memoize form template for definvoke

(invoke-intern-memoize :memoize 'hello {} '([x] x))

creates a memoize form template for `definvoke`

(invoke-intern-memoize :memoize 'hello {} '([x] x))
raw docstring

memoizeclj

(memoize function cache var)
(memoize function cache var registry status)

caches the result of a function (ns-unmap ns '+-inc-) (ns-unmap ns '-inc-) (def +-inc- (atom {})) (declare -inc-) (def -inc- (memoize inc +-inc- #'-inc-))

(-inc- 1) => 2 (-inc- 2) => 3

caches the result of a function
(ns-unmap *ns* '+-inc-)
(ns-unmap *ns* '-inc-)
(def +-inc- (atom {}))
(declare -inc-)
(def -inc-  (memoize inc +-inc- #'-inc-))

(-inc- 1) => 2
(-inc- 2) => 3
raw docstring

memoize-clearclj

(memoize-clear mem)

clears all results

(memoize-clear -inc-) => '{(2) 3}

clears all results

(memoize-clear -inc-)
=> '{(2) 3}
raw docstring

memoize-disableclj

(memoize-disable mem)

disables the usage of the cache

@(memoize-disable -inc-) => :disabled

disables the usage of the cache

@(memoize-disable -inc-)
=> :disabled
raw docstring

memoize-disabled?clj

(memoize-disabled? mem)

checks if the memoized function is disabled

(memoize-disabled? -inc-) => true

checks if the memoized function is disabled

(memoize-disabled? -inc-)
=> true
raw docstring

memoize-displayclj

(memoize-display mem)

formats the memoize object

(def +-plus- (atom {})) (declare -plus-) (def -plus- (memoize + +-plus- #'-plus-)) (memoize-display -plus-) => (contains {:status :enabled, :registered false, :items number?}) ;; {:fn +, :cache #atom {(1 1) 2}}

formats the memoize object

(def +-plus- (atom {}))
(declare -plus-)
(def -plus- (memoize + +-plus- #'-plus-))
(memoize-display -plus-)
=> (contains {:status :enabled, :registered false, :items number?})
;; {:fn +, :cache #atom {(1 1) 2}}
raw docstring

memoize-enableclj

(memoize-enable mem)

enables the usage of the cache

@(memoize-enable -inc-) => :enabled

enables the usage of the cache

@(memoize-enable -inc-)
=> :enabled
raw docstring

memoize-enabled?clj

(memoize-enabled? mem)

checks if the memoized function is disabled

(memoize-enabled? -inc-) => true

checks if the memoized function is disabled

(memoize-enabled? -inc-)
=> true
raw docstring

memoize-invokeclj

(memoize-invoke mem & args)

invokes the function with arguments

(memoize-invoke -plus- 1 2 3) => 6

invokes the function with arguments

(memoize-invoke -plus- 1 2 3)
=> 6
raw docstring

memoize-removeclj

(memoize-remove mem & args)

removes a cached result

(memoize-remove -inc- 1) => 2

removes a cached result

(memoize-remove -inc- 1)
=> 2
raw docstring

memoize-statusclj

(memoize-status mem)

returns the status of the object

(memoize-status -inc-) => :enabled

returns the status of the object

(memoize-status -inc-)
=> :enabled
raw docstring

register-memoizeclj

(register-memoize mem)
(register-memoize mem var registry)

registers the memoize function

(register-memoize -inc-)

registers the memoize function

(register-memoize -inc-)
raw docstring

registered-memoize?clj

(registered-memoize? mem)

checks if a memoize function is registered

(registered-memoize? -mem-) => false

checks if a memoize function is registered

(registered-memoize? -mem-)
=> false
raw docstring

registered-memoizesclj

(registered-memoizes)
(registered-memoizes status)
(registered-memoizes status registry)

lists all registered memoizes

(registered-memoizes)

lists all registered memoizes

(registered-memoizes)
raw docstring

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

× close