CLJS
basic-lein-cljs.core
cljs.analyzer
cljs.compiler
CLJS
cljs.core
CLJS
cljs.core.async
CLJS
cljs.core.async.impl.buffers
CLJS
cljs.core.async.impl.channels
CLJS
cljs.core.async.impl.dispatch
CLJS
cljs.core.async.impl.ioc-helpers
CLJS
cljs.core.async.impl.protocols
CLJS
cljs.core.async.impl.timers
cljs.env
cljs.externs
CLJS
cljs.js
cljs.js-deps
CLJS
cljs.pprint
CLJS
cljs.reader
CLJS
cljs.repl
cljs.source-map
CLJS
cljs.source-map
cljs.source-map.base64
CLJS
cljs.source-map.base64
cljs.source-map.base64-vlq
CLJS
cljs.source-map.base64-vlq
CLJS
cljs.spec.alpha
CLJS
cljs.spec.gen.alpha
cljs.tagged-literals
CLJS
cljs.tools.reader
CLJS
cljs.tools.reader.edn
CLJS
cljs.tools.reader.impl.commons
CLJS
cljs.tools.reader.impl.errors
CLJS
cljs.tools.reader.impl.inspect
CLJS
cljs.tools.reader.impl.utils
CLJS
cljs.tools.reader.reader-types
cljs.util
clojure.core
clojure.core.async
clojure.core.async.impl.buffers
clojure.core.async.impl.channels
clojure.core.async.impl.concurrent
clojure.core.async.impl.dispatch
clojure.core.async.impl.exec.threadpool
clojure.core.async.impl.ioc-macros
clojure.core.async.impl.mutex
clojure.core.async.impl.protocols
clojure.core.async.impl.timers
clojure.core.cache
clojure.core.memoize
clojure.core.protocols
clojure.core.server
clojure.data.json
clojure.data.priority-map
clojure.edn
clojure.instant
clojure.java.io
clojure.main
clojure.pprint
clojure.reflect
clojure.repl
clojure.set
CLJS
clojure.set
clojure.spec.alpha
clojure.spec.gen.alpha
clojure.string
CLJS
clojure.string
clojure.tools.analyzer
clojure.tools.analyzer.ast
clojure.tools.analyzer.env
clojure.tools.analyzer.jvm
clojure.tools.analyzer.jvm.utils
clojure.tools.analyzer.passes
clojure.tools.analyzer.passes.add-binding-atom
clojure.tools.analyzer.passes.cleanup
clojure.tools.analyzer.passes.constant-lifter
clojure.tools.analyzer.passes.elide-meta
clojure.tools.analyzer.passes.emit-form
clojure.tools.analyzer.passes.jvm.analyze-host-expr
clojure.tools.analyzer.passes.jvm.annotate-host-info
clojure.tools.analyzer.passes.jvm.annotate-loops
clojure.tools.analyzer.passes.jvm.annotate-tag
clojure.tools.analyzer.passes.jvm.box
clojure.tools.analyzer.passes.jvm.classify-invoke
clojure.tools.analyzer.passes.jvm.constant-lifter
clojure.tools.analyzer.passes.jvm.emit-form
clojure.tools.analyzer.passes.jvm.fix-case-test
clojure.tools.analyzer.passes.jvm.infer-tag
clojure.tools.analyzer.passes.jvm.validate
clojure.tools.analyzer.passes.jvm.validate-loop-locals
clojure.tools.analyzer.passes.jvm.validate-recur
clojure.tools.analyzer.passes.jvm.warn-on-reflection
clojure.tools.analyzer.passes.source-info
clojure.tools.analyzer.passes.trim
clojure.tools.analyzer.passes.uniquify
clojure.tools.analyzer.passes.warn-earmuff
clojure.tools.analyzer.utils
clojure.tools.cli
clojure.tools.namespace.dependency
clojure.tools.namespace.file
clojure.tools.namespace.find
clojure.tools.namespace.parse
clojure.tools.namespace.track
clojure.tools.reader
clojure.tools.reader.default-data-readers
clojure.tools.reader.impl.commons
clojure.tools.reader.impl.errors
clojure.tools.reader.impl.inspect
clojure.tools.reader.impl.utils
clojure.tools.reader.reader-types
clojure.walk
CLJS
clojure.walk
dynadoc.aliases
dynadoc.common
dynadoc.core
CLJS
dynadoc.core
dynadoc.example
CLJS
dynadoc.state
dynadoc.static
dynadoc.utils
dynadoc.watch
eval-soup.clojail
eval-soup.core
CLJS
eval-soup.core
CLJS
figwheel.client
CLJS
figwheel.client.file-reloading
CLJS
figwheel.client.heads-up
CLJS
figwheel.client.socket
CLJS
figwheel.client.utils
hawk.core
hawk.watcher
html-soup.core
ns-tracker.core
ns-tracker.dependency
ns-tracker.nsdeps
ns-tracker.parse
CLJS
oakcljs.tools.reader
CLJS
oakcljs.tools.reader.impl.commons
CLJS
oakcljs.tools.reader.impl.errors
CLJS
oakcljs.tools.reader.impl.inspect
CLJS
oakcljs.tools.reader.impl.utils
CLJS
oakcljs.tools.reader.reader-types
oakclojure.tools.reader
oakclojure.tools.reader.default-data-readers
oakclojure.tools.reader.impl.commons
oakclojure.tools.reader.impl.errors
oakclojure.tools.reader.impl.inspect
oakclojure.tools.reader.impl.utils
oakclojure.tools.reader.reader-types
org.httpkit.server
CLJS
paren-soup.console
CLJS
paren-soup.core
CLJS
paren-soup.dom
CLJS
paren-soup.instarepl
CLJS
reagent.core
CLJS
reagent.debug
CLJS
reagent.dom
CLJS
reagent.impl.batching
CLJS
reagent.impl.component
CLJS
reagent.impl.template
CLJS
reagent.impl.util
CLJS
reagent.ratom
ring.middleware.content-type
ring.middleware.file
ring.middleware.head
ring.middleware.keyword-params
ring.middleware.params
ring.middleware.reload
ring.middleware.resource
ring.util.codec
ring.util.io
ring.util.mime-type
ring.util.parsing
ring.util.request
ring.util.response
ring.util.time
rum.core
CLJS
rum.core
rum.cursor
rum.derived-atom
rum.server-render
rum.util
sablono.compiler
CLJS
sablono.core
sablono.normalize
sablono.util
tag-soup.core

clojure.core.memoize

core.memoize is a memoization library offering functionality above Clojure's core `memoize` function in the following ways: **Pluggable memoization** core.memoize allows for different back-end cache implmentations to be used as appropriate without changing the memoization modus operandi. **Manipulable memoization** Because core.memoize allows you to access a function's memoization store, you do interesting things like clear it, modify it, and save it for later.

(->PluggableMemoization f cache)

Positional factory function for class clojure.core.memoize.PluggableMemoization.

(->RetryingDelay fun available? value)

Positional factory function for class clojure.core.memoize.RetryingDelay.

(build-memoizer cache-factory f & args)

Builds a function that given a function, returns a pluggable memoized version of it. `build-memoizer` Takes a cache factory function, a function to memoize, and the arguments to the factory. At least one of those functions should be the function to be memoized.

(fifo f)

(fifo f base)

(fifo f tkey threshold)

(fifo f base key threshold)

Works the same as the basic memoization function (i.e. `memo` and `core.memoize` except when a given threshold is breached. Observe the following: (require '[clojure.core.memoize :as memo]) (def id (memo/fifo identity :fifo/threshold 2)) (id 42) (id 43) (snapshot id) ;=> {[42] 42, [43] 43} As you see, the limit of `2` has not been breached yet, but if you call again with another value, then it is: (id 44) (snapshot id) ;=> {[44] 44, [43] 43} That is, the oldest entry `42` is pushed out of the memoization cache. This is the standard **F**irst **I**n **F**irst **O**ut behavior.

(lru f)

(lru f base)

(lru f tkey threshold)

(lru f base key threshold)

Works the same as the basic memoization function (i.e. `memo` and `core.memoize` except when a given threshold is breached. Observe the following: (require '[clojure.core.memoize :as memo]) (def id (memo/lru identity :lru/threshold 2)) (id 42) (id 43) (snapshot id) ;=> {[42] 42, [43] 43} At this point the cache has not yet crossed the set threshold of `2`, but if you execute yet another call the story will change: (id 44) (snapshot id) ;=> {[44] 44, [43] 43} At this point the operation of the LRU cache looks exactly the same at the FIFO cache. However, the difference becomes apparent on further use: (id 43) (id 0) (snapshot id) ;=> {[0] 0, [43] 43} As you see, once again calling `id` with the argument `43` will expose the LRU nature of the underlying cache. That is, when the threshold is passed, the cache will expel the **L**east **R**ecently **U**sed element in favor of the new.

(lu f)

(lu f base)

(lu f tkey threshold)

(lu 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.

(memo f)

(memo f seed)

Used as a more flexible alternative to Clojure's core `memoization` function. Memoized functions built using `memo` will respond to the core.memo manipulable memoization utilities. As a nice bonus, you can use `memo` in place of `memoize` without any additional changes. The default way to use this function is to simply apply a function that will be memoized. Additionally, you may also supply a map of the form `'{[42] 42, [108] 108}` where keys are a vector mapping expected argument values to arity positions. The map values are the return values of the memoized function. You can access the memoization cache directly via the `:clojure.core.memoize/cache` key on the memoized function's metadata. However, it is advised to use the core.memo primitives instead as implementation details may change over time.

(memo-clear! f)

(memo-clear! f args)

Reaches into an core.memo-memoized function and clears the cache. This is a destructive operation and should be used with care. When the second argument is a vector of input arguments, clears cache only for argument vector. Keep in mind that depending on what other threads or doing, an immediate call to `snapshot` may not yield an empty cache. That's cool though, we've learned to deal with that stuff in Clojure by now.

(memo-fifo f)

(memo-fifo f limit)

(memo-fifo f limit base)

DEPRECATED: Please use clojure.core.memoize/fifo instead.

(memo-lru f)

(memo-lru f limit)

(memo-lru f limit base)

DEPRECATED: Please use clojure.core.memoize/lru instead.

(memo-lu f)

(memo-lu f limit)

(memo-lu f limit base)

DEPRECATED: Please use clojure.core.memoize/lu instead.

(memo-swap! f base)

Takes a core.memo-populated function and a map and replaces the memoization cache with the supplied map. This is potentially some serious voodoo, since you can effectively change the semantics of a function on the fly. (def id (memo identity)) (memo-swap! id '{[13] :omg}) (id 13) ;=> :omg With great power comes ... yadda yadda yadda.

(memo-ttl f)

(memo-ttl f limit)

(memo-ttl f limit base)

DEPRECATED: Please use clojure.core.memoize/ttl instead.

(memoized? f)

Returns true if a function has an core.memo-placed cache, false otherwise.

(snapshot memoized-fn)

Returns a snapshot of a core.memo-placed memoization cache. By snapshot you can infer that what you get is only the cache contents at a moment in time.

(ttl f)

(ttl f base)

(ttl f tkey threshold)

(ttl f base key threshold)

Unlike many of the other core.memo memoization functions, `memo-ttl`'s cache policy is time-based rather than algortihmic or explicit. When memoizing a function using `memo-ttl` you should provide a **T**ime **T**o **L**ive parameter in milliseconds. (require '[clojure.core.memoize :as memo]) (def id (memo/ttl identity :ttl/threshold 5000)) (id 42) (snapshot id) ;=> {[42] 42} ... wait 5 seconds ... (id 43) (snapshot id) ;=> {[43] 43} The expired cache entries will be removed on each cache **miss**.