The function-cache Reference Manual

This is the function-cache Reference Manual, version 1.0.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 05:13:41 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 function-cache

A Simple Caching Layer for functions

Author

Acceleration.net <>

License

BSD

Version

1.0.3

Dependencies
  • alexandria (system).
  • cl-interpol (system).
  • iterate (system).
  • symbol-munger (system).
  • closer-mop (system).
Source

function-cache.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 function-cache/src

Source

function-cache.asd.

Parent Component

function-cache (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 function-cache/function-cache.asd

Source

function-cache.asd.

Parent Component

function-cache (system).

ASDF Systems

function-cache.

Packages

function-cache-system.


4.1.2 function-cache/src/packages.lisp

Source

function-cache.asd.

Parent Component

src (module).

Packages

function-cache.


4.1.3 function-cache/src/protocol.lisp

Dependency

packages.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.4 function-cache/src/capacity.lisp

Dependency

protocol.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

number-to-remove (function).


4.1.5 function-cache/src/metering.lisp

Dependency

capacity.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.6 function-cache/src/function-cache.lisp

Dependency

metering.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.7 function-cache/src/thunk.lisp

Dependency

function-cache.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

key-cached? (method).


4.1.8 function-cache/src/single-cell.lisp

Dependency

thunk.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.9 function-cache/src/hash-table.lisp

Dependency

single-cell.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.10 function-cache/src/ordered.lisp

Dependency

hash-table.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.11 function-cache/src/cache.lisp

Dependency

ordered.lisp (file).

Source

function-cache.asd.

Parent Component

src (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 function-cache-system

Source

function-cache.asd.

Use List
  • asdf/interface.
  • common-lisp.

5.2 function-cache

A simple caching layer for functions

Source

packages.lisp.

Use List
  • common-lisp.
  • iterate.
Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Special variables

Special Variable: *bypass-cache*

if non-nil, skip any kind of caching

Package

function-cache.

Source

function-cache.lisp.

Special Variable: *cache-names*

A list of all function-caches

Package

function-cache.

Source

cache.lisp.

Special Variable: *default-cache-class*

cache class to use if unspecified and thunk is not applicable

Package

function-cache.

Source

cache.lisp.


6.1.2 Macros

Macro: defcached (symbol lambda-list &body body)

Creates a cached function named SYMBOL and a cache object named *{FN-NAME}-CACHE* SYMBOL can also be a list (FN-NAME &rest CACHE-INIT-ARGS
&key CACHE-CLASS TABLE TIMEOUT SHARED-RESULTS?)

TABLE - a shared cache-store to use, usually a hash-table, a function that returns a hashtable, or a symbol whose value is a hash-table
TIMEOUT - how long entries in the cache should be considered valid for CACHE-CLASS - controls what cache class will be instantiated (uses default-cache-class if not provided)
SHARED-RESULTS? - do we expect that we are sharing cache space with other things defaults to t if TABLE is provided
CACHE-INIT-ARGS - any other args that should be passed to the cache

Package

function-cache.

Source

cache.lisp.


6.1.3 Ordinary functions

Function: accesses (cache)

how many total accesses this cache has seen

Package

function-cache.

Source

metering.lisp.

Function: clear-all-caches (&optional package)

Clear all the packages we know about. If there is a package mentioned, clear only those caches whose names are in that package

Package

function-cache.

Source

cache.lisp.

Function: clear-cache-all-function-caches (&optional package)
Package

function-cache.

Source

cache.lisp.

Function: find-function-cache-for-name (cache-name)

given a name get the cache object associated with it

Package

function-cache.

Source

cache.lisp.

Function: hit-ratio (cache)
Package

function-cache.

Source

metering.lisp.

Function: purge-all-caches (&optional package)

Call purge on all matching cache objects. If package is provided, purge only caches located within that package

Package

function-cache.

Source

cache.lisp.


6.1.4 Generic functions

Generic Function: at-cache-capacity? (cache)

is the cache full?

Package

function-cache.

Source

protocol.lisp.

Methods
Method: at-cache-capacity? ((cache cache-capacity-mixin))
Source

capacity.lisp.

Method: at-cache-capacity? (cache)
Generic Function: cached-results (object)
Package

function-cache.

Methods
Reader Method: cached-results :around ((cache function-cache))

Coerce the refernce to the results into something we can use

Source

function-cache.lisp.

Target Slot

cached-results.

Method: cached-results ((function-cache function-cache))

automatically generated reader method

Source

function-cache.lisp.

Generic Writer: (setf cached-results) (object)
Package

function-cache.

Methods
Writer Method: (setf cached-results) ((function-cache function-cache))

automatically generated writer method

Source

function-cache.lisp.

Target Slot

cached-results.

Generic Function: cached-results-count (cache)

A function to compute the number of results that have been cached. DOES NOT CHECK to see if the entries are expired

Package

function-cache.

Source

protocol.lisp.

Methods
Method: cached-results-count ((cache hash-table-function-cache))
Source

hash-table.lisp.

Method: cached-results-count ((cache single-cell-function-cache))
Source

single-cell.lisp.

Method: cached-results-count ((cache thunk-cache))
Source

thunk.lisp.

Method: cached-results-count ((x null))
Method: cached-results-count ((res list))
Method: cached-results-count ((res hash-table))
Generic Reader: capacity (object)
Generic Writer: (setf capacity) (object)
Package

function-cache.

Methods
Reader Method: capacity ((cache-capacity-mixin cache-capacity-mixin))
Writer Method: (setf capacity) ((cache-capacity-mixin cache-capacity-mixin))

The maximum number of objects cached, when we hit this we will reduce the number of cached entries by reduce-by-ratio

Source

capacity.lisp.

Target Slot

capacity.

Generic Function: clear-cache (cache &optional args)

Clears a given cache

Package

function-cache.

Source

protocol.lisp.

Methods
Method: clear-cache ((cache-name symbol) &optional args)
Source

cache.lisp.

Method: clear-cache ((cache-name null) &optional args)
Source

cache.lisp.

Method: clear-cache :after ((cache ordered-cache-mixin) &optional args)
Source

ordered.lisp.

Method: clear-cache ((cache hash-table-function-cache) &optional args)
Source

hash-table.lisp.

Method: clear-cache ((cache function-cache) &optional args)
Source

function-cache.lisp.

Generic Function: clear-cache-partial-arguments (cache to-match)

This function will go through the cached-results removing
keys that partially match the to-match list.

This is used to clear the cache of shared? caches, but is also useful in other cases, where we need to clear cache for some subset of the arguments (eg: a cached funcall might wish to clear the cache of a specific funcalled function).

Matches arguments for those provided. Anything not provided is considered function-cache:dont-care. Anything specified as function-cache:dont-care is not used to determine if there is a match

Package

function-cache.

Source

hash-table.lisp.

Methods
Method: clear-cache-partial-arguments :after ((cache ordered-cache-mixin) to-match)
Source

ordered.lisp.

Method: clear-cache-partial-arguments ((cache hash-table-function-cache) to-match)
Generic Function: compute-cache-key (cache thing)

Used to assemble cache keys for function-cache objects

Package

function-cache.

Source

function-cache.lisp.

Methods
Method: compute-cache-key ((cache function-cache) thing)
Generic Function: defcached-hashkey (thing)

Turns a list of arguments into a valid cache-key (usually a tree of primatives)

Package

function-cache.

Source

protocol.lisp.

Methods
Method: defcached-hashkey (thing)
Generic Function: get-cached-value (cache cache-key)

returns the result-values-list and at what time it was cached

Package

function-cache.

Source

protocol.lisp.

Methods
Method: get-cached-value :around ((cache ordered-cache-mixin) cache-key)
Source

ordered.lisp.

Method: get-cached-value ((cache hash-table-function-cache) cache-key)
Source

hash-table.lisp.

Method: get-cached-value ((cache single-cell-function-cache) cache-key)
Source

single-cell.lisp.

Method: get-cached-value ((cache thunk-cache) cache-key)
Source

thunk.lisp.

Method: get-cached-value :around ((cache metered-mixin) cache-key)
Source

metering.lisp.

Generic Function: (setf get-cached-value) (cache cache-key)

Set the cached value for the cache key

Package

function-cache.

Source

protocol.lisp.

Methods
Method: (setf get-cached-value) :around ((cache ordered-cache-mixin) cache-key)
Source

ordered.lisp.

Method: (setf get-cached-value) ((cache hash-table-function-cache) cache-key)
Source

hash-table.lisp.

Method: (setf get-cached-value) ((cache single-cell-function-cache) cache-key)
Source

single-cell.lisp.

Method: (setf get-cached-value) ((cache thunk-cache) cache-key)
Source

thunk.lisp.

Method: (setf get-cached-value) :before ((cache cache-capacity-mixin) cache-key)
Source

capacity.lisp.

Method: (setf get-cached-value) :around (cache cache-key)
Generic Reader: hits (object)
Generic Writer: (setf hits) (object)
Package

function-cache.

Methods
Reader Method: hits ((metered-mixin metered-mixin))
Writer Method: (setf hits) ((metered-mixin metered-mixin))

how many cache hits

Source

metering.lisp.

Target Slot

hits.

Generic Reader: misses (object)
Generic Writer: (setf misses) (object)
Package

function-cache.

Methods
Reader Method: misses ((metered-mixin metered-mixin))
Writer Method: (setf misses) ((metered-mixin metered-mixin))

how many cache hits

Source

metering.lisp.

Target Slot

misses.

Generic Function: partial-argument-match? (cache cached-key to-match &key test)

Trys to see if the cache-key matches the to-match partial
key passed in.

The basic implementation is to go through the cache-keys and match in order, skipping to-match component that is function-cache:dont-care

Package

function-cache.

Source

hash-table.lisp.

Methods
Method: partial-argument-match? ((cache hash-table-function-cache) cached-key to-match &key test)
Generic Function: purge-cache (cache)

A function that will remove expired entries from the cache, allowing them to be garbage collected

Package

function-cache.

Source

protocol.lisp.

Methods
Method: purge-cache ((cache-name symbol))
Source

cache.lisp.

Method: purge-cache :after ((cache ordered-cache-mixin))
Source

ordered.lisp.

Method: purge-cache ((cache hash-table-function-cache))
Source

hash-table.lisp.

Method: purge-cache ((cache single-cell-function-cache))
Source

single-cell.lisp.

Method: purge-cache ((cache thunk-cache))
Source

thunk.lisp.

Method: purge-cache :around ((cache function-cache))
Source

function-cache.lisp.

Generic Reader: reduce-by-ratio (object)
Generic Writer: (setf reduce-by-ratio) (object)
Package

function-cache.

Methods
Reader Method: reduce-by-ratio ((cache-capacity-mixin cache-capacity-mixin))
Writer Method: (setf reduce-by-ratio) ((cache-capacity-mixin cache-capacity-mixin))

Remove the oldest reduce-by-ratio entries (eg: .2 or 20%)

Source

capacity.lisp.

Target Slot

reduce-by-ratio.

Generic Function: reduce-cached-set (cache n)

evict n items from the cache

Package

function-cache.

Source

protocol.lisp.

Methods
Method: reduce-cached-set ((cache mru-cache) n)
Source

ordered.lisp.

Method: reduce-cached-set ((cache lru-cache) n)
Source

ordered.lisp.

Method: reduce-cached-set ((cache hash-table-function-cache) n)
Source

hash-table.lisp.

Generic Function: reset-counters (cache)

When we clear the full cache, reset the counters

Package

function-cache.

Source

metering.lisp.

Methods
Method: reset-counters ((cache symbol))
Method: reset-counters ((cache metered-mixin))
Generic Reader: timeout (object)
Package

function-cache.

Methods
Reader Method: timeout ((function-cache function-cache))

automatically generated reader method

Source

function-cache.lisp.

Target Slot

timeout.

Generic Writer: (setf timeout) (object)
Package

function-cache.

Methods
Writer Method: (setf timeout) ((function-cache function-cache))

automatically generated writer method

Source

function-cache.lisp.

Target Slot

timeout.


6.1.5 Standalone methods

Method: initialize-instance :after ((cache function-cache) &key &allow-other-keys)
Source

function-cache.lisp.

Method: print-object ((o function-cache) s)
Source

function-cache.lisp.


6.1.6 Classes

Class: cache-capacity-mixin
Package

function-cache.

Source

capacity.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: capacity

The maximum number of objects cached, when we hit this we will reduce the number of cached entries by reduce-by-ratio

Initargs

:capacity

Readers

capacity.

Writers

(setf capacity).

Slot: reduce-by-ratio

Remove the oldest reduce-by-ratio entries (eg: .2 or 20%)

Initform

0.2

Initargs

:reduce-by-ratio

Readers

reduce-by-ratio.

Writers

(setf reduce-by-ratio).

Class: hash-table-function-cache

a function cache that uses a hash-table to store results

Package

function-cache.

Source

hash-table.lisp.

Direct superclasses

function-cache.

Direct subclasses
Direct methods
Direct slots
Slot: hash-init-args
Initform

function-cache::*default-hash-init-args*

Initargs

:hash-init-args

Readers

hash-init-args.

Writers

(setf hash-init-args).

Class: hash-table-function-cache-with-capacity

a function cache that uses a hash-table to store results with a max capacity

Package

function-cache.

Source

hash-table.lisp.

Direct superclasses
Class: lru-cache

LRU cache backed by a hash-table.
Maintains capacity by removing least recently used cached values.

Package

function-cache.

Source

ordered.lisp.

Direct superclasses
Direct methods

reduce-cached-set.

Class: metered-mixin

adds some recording for caches hits/misses

Package

function-cache.

Source

metering.lisp.

Direct subclasses

metered-hash-table-cache.

Direct methods
Direct slots
Slot: hits

how many cache hits

Initform

0

Readers

hits.

Writers

(setf hits).

Slot: misses

how many cache hits

Initform

0

Readers

misses.

Writers

(setf misses).

Class: mru-cache

MRU cache backed by a hash-table.
Maintains capacity by removing the most recently used cached value.s

Package

function-cache.

Source

ordered.lisp.

Direct superclasses
Direct methods

reduce-cached-set.

Class: single-cell-function-cache

a cache that stores only the most recent result of running the body

Package

function-cache.

Source

single-cell.lisp.

Direct superclasses

function-cache.

Direct methods
Direct slots
Slot: test
Initform

(function equal)

Initargs

:test

Readers

test.

Writers

(setf test).

Class: thunk-cache

a cache optimized for functions of no arguments (uses a cons for caching)

Package

function-cache.

Source

thunk.lisp.

Direct superclasses

function-cache.

Direct methods

6.2 Internals


6.2.1 Special variables

Special Variable: *cache*
Package

function-cache.

Source

protocol.lisp.

Special Variable: *cached-at*
Package

function-cache.

Source

protocol.lisp.

Special Variable: *default-hash-init-args*
Package

function-cache.

Source

hash-table.lisp.


6.2.2 Ordinary functions

Function: %add-cached-node (cache node)

Add a node to the last position of the cache.

Package

function-cache.

Source

ordered.lisp.

Function: %call-list-for-lambda-list (lambda-list)

Turns a lambda list into a list that can be applied to functions of that lambda list

Package

function-cache.

Source

cache.lisp.

Function: %ensure-unquoted (thing)
Package

function-cache.

Source

cache.lisp.

Function: %insert-into-cache (cache args &key cache-key)

Simple helper to run the body, store the results in the cache and then return them

Package

function-cache.

Source

function-cache.lisp.

Function: %move-cached-node (cache node)

Move a node to the end of the cache, should be called when a cached result has been used.

Package

function-cache.

Source

ordered.lisp.

Function: %remove-cached-node (cache node)

Remove a node from the cache.

Package

function-cache.

Source

ordered.lisp.

Function: cnode (cache-key result &optional older newer)
Package

function-cache.

Source

ordered.lisp.

Reader: cnode-cache-key (instance)
Writer: (setf cnode-cache-key) (instance)
Package

function-cache.

Source

ordered.lisp.

Target Slot

cache-key.

Reader: cnode-newer (instance)
Writer: (setf cnode-newer) (instance)
Package

function-cache.

Source

ordered.lisp.

Target Slot

newer.

Reader: cnode-older (instance)
Writer: (setf cnode-older) (instance)
Package

function-cache.

Source

ordered.lisp.

Target Slot

older.

Function: cnode-p (object)
Package

function-cache.

Source

ordered.lisp.

Reader: cnode-result (instance)
Writer: (setf cnode-result) (instance)
Package

function-cache.

Source

ordered.lisp.

Target Slot

result.

Function: copy-cnode (instance)
Package

function-cache.

Source

ordered.lisp.

Function: do-caches (fn &key package)

Iterate through caches calling fn on each matching cache

Package

function-cache.

Source

cache.lisp.

Function: get-cached-object-stats (cache)
Package

function-cache.

Source

metering.lisp.

Function: incf-hash (key ht &optional delta default)
Package

function-cache.

Source

metering.lisp.

Function: number-to-remove (cache)
Package

function-cache.

Source

capacity.lisp.

Function: sync-ordered-cache (cache)

Remove any nodes from the dlist that are no longer in the actual cache.

Package

function-cache.

Source

ordered.lisp.


6.2.3 Generic functions

Generic Reader: body-fn (object)
Package

function-cache.

Methods
Reader Method: body-fn ((function-cache function-cache))

automatically generated reader method

Source

function-cache.lisp.

Target Slot

body-fn.

Generic Writer: (setf body-fn) (object)
Package

function-cache.

Methods
Writer Method: (setf body-fn) ((function-cache function-cache))

automatically generated writer method

Source

function-cache.lisp.

Target Slot

body-fn.

Generic Reader: cache (condition)
Generic Writer: (setf cache) (condition)
Package

function-cache.

Methods
Reader Method: cache ((condition cache-value-condition))
Writer Method: (setf cache) ((condition cache-value-condition))
Source

protocol.lisp.

Target Slot

cache.

Generic Reader: cached-at (condition)
Generic Writer: (setf cached-at) (condition)
Package

function-cache.

Methods
Reader Method: cached-at ((condition cache-value-condition))
Writer Method: (setf cached-at) ((condition cache-value-condition))
Source

protocol.lisp.

Target Slot

cached-at.

Generic Function: cacher (cache args)

A function that takes a cache object and an arg list
and either runs the computation and fills the caches or retrieves the cached value

Package

function-cache.

Source

function-cache.lisp.

Methods
Method: cacher ((cache function-cache) args)
Generic Function: default-cache-class (symbol lambda-list)

A function that takes symbol lambda-list and perhaps a cache-class

Package

function-cache.

Source

cache.lisp.

Methods
Method: default-cache-class (symbol lambda-list)
Generic Function: expired? (cache result-timeout)

Determines if the cache entry is expired

Package

function-cache.

Source

protocol.lisp.

Methods
Method: expired? (cache result-timeout)
Generic Reader: hash-init-args (object)
Package

function-cache.

Methods
Reader Method: hash-init-args ((hash-table-function-cache hash-table-function-cache))

automatically generated reader method

Source

hash-table.lisp.

Target Slot

hash-init-args.

Generic Writer: (setf hash-init-args) (object)
Package

function-cache.

Methods
Writer Method: (setf hash-init-args) ((hash-table-function-cache hash-table-function-cache))

automatically generated writer method

Source

hash-table.lisp.

Target Slot

hash-init-args.

Generic Reader: key (condition)
Generic Writer: (setf key) (condition)
Package

function-cache.

Methods
Reader Method: key ((condition cache-value-condition))
Writer Method: (setf key) ((condition cache-value-condition))
Source

protocol.lisp.

Target Slot

key.

Generic Function: key-cached? (cache cache-key)

Check if the cache contains a cached value for the key.
This should not have any side affects, even if GET-CACHED-VALUE does (for instance in an LRU cache). Return non-nil if the cache contains an entry with the specified key.

Note that this returns non-nil if the key is cached but expired.

Package

function-cache.

Source

protocol.lisp.

Methods
Method: key-cached? ((cache hash-table-function-cache) cache-key)
Source

hash-table.lisp.

Method: key-cached? ((cache single-cell-function-cache) cache-key)
Source

single-cell.lisp.

Method: key-cached? ((cache thunk-cache) cache-key)
Source

thunk.lisp.

Method: key-cached? (cache key)
Generic Reader: lambda-list (object)
Package

function-cache.

Methods
Reader Method: lambda-list ((function-cache function-cache))

automatically generated reader method

Source

function-cache.lisp.

Target Slot

lambda-list.

Generic Writer: (setf lambda-list) (object)
Package

function-cache.

Methods
Writer Method: (setf lambda-list) ((function-cache function-cache))

automatically generated writer method

Source

function-cache.lisp.

Target Slot

lambda-list.

Generic Function: make-cache-backing (cache)

make a new backing storage for the cache

Package

function-cache.

Source

protocol.lisp.

Methods
Method: make-cache-backing ((cache hash-table-function-cache))
Source

hash-table.lisp.

Method: make-cache-backing ((cache single-cell-function-cache))
Source

single-cell.lisp.

Method: make-cache-backing (cache)
Generic Reader: name (object)
Package

function-cache.

Methods
Reader Method: name ((function-cache function-cache))

automatically generated reader method

Source

function-cache.lisp.

Target Slot

name.

Generic Writer: (setf name) (object)
Package

function-cache.

Methods
Writer Method: (setf name) ((function-cache function-cache))

automatically generated writer method

Source

function-cache.lisp.

Target Slot

name.

Generic Reader: newest-node (object)
Package

function-cache.

Methods
Reader Method: newest-node ((ordered-cache-mixin ordered-cache-mixin))

automatically generated reader method

Source

ordered.lisp.

Target Slot

newest.

Generic Writer: (setf newest-node) (object)
Package

function-cache.

Methods
Writer Method: (setf newest-node) ((ordered-cache-mixin ordered-cache-mixin))

automatically generated writer method

Source

ordered.lisp.

Target Slot

newest.

Generic Reader: oldest-node (object)
Package

function-cache.

Methods
Reader Method: oldest-node ((ordered-cache-mixin ordered-cache-mixin))

automatically generated reader method

Source

ordered.lisp.

Target Slot

oldest.

Generic Writer: (setf oldest-node) (object)
Package

function-cache.

Methods
Writer Method: (setf oldest-node) ((ordered-cache-mixin ordered-cache-mixin))

automatically generated writer method

Source

ordered.lisp.

Target Slot

oldest.

Generic Reader: removed-at (condition)
Generic Writer: (setf removed-at) (condition)
Package

function-cache.

Methods
Reader Method: removed-at ((condition removed-a-value))
Writer Method: (setf removed-at) ((condition removed-a-value))
Source

protocol.lisp.

Target Slot

removed-at.

Generic Reader: shared-results? (object)
Package

function-cache.

Methods
Reader Method: shared-results? ((function-cache function-cache))

automatically generated reader method

Source

function-cache.lisp.

Target Slot

shared-results?.

Generic Writer: (setf shared-results?) (object)
Package

function-cache.

Methods
Writer Method: (setf shared-results?) ((function-cache function-cache))

automatically generated writer method

Source

function-cache.lisp.

Target Slot

shared-results?.

Generic Reader: test (object)
Package

function-cache.

Methods
Reader Method: test ((single-cell-function-cache single-cell-function-cache))

automatically generated reader method

Source

single-cell.lisp.

Target Slot

test.

Generic Writer: (setf test) (object)
Package

function-cache.

Methods
Writer Method: (setf test) ((single-cell-function-cache single-cell-function-cache))

automatically generated writer method

Source

single-cell.lisp.

Target Slot

test.

Generic Reader: value (condition)
Generic Writer: (setf value) (condition)
Package

function-cache.

Methods
Reader Method: value ((condition cache-value-condition))
Writer Method: (setf value) ((condition cache-value-condition))
Source

protocol.lisp.

Target Slot

value.


6.2.4 Conditions

Condition: cache-value-condition
Package

function-cache.

Source

protocol.lisp.

Direct superclasses

condition.

Direct subclasses
Direct methods
Direct slots
Slot: cache
Initform

(quote nil)

Initargs

:cache

Readers

cache.

Writers

(setf cache).

Slot: key
Initform

(quote nil)

Initargs

:key

Readers

key.

Writers

(setf key).

Slot: value
Initform

(quote nil)

Initargs

:value

Readers

value.

Writers

(setf value).

Slot: cached-at
Initform

(quote nil)

Initargs

:cached-at

Readers

cached-at.

Writers

(setf cached-at).

Condition: cached-a-value
Package

function-cache.

Source

protocol.lisp.

Direct superclasses

cache-value-condition.

Condition: expired-a-value
Package

function-cache.

Source

protocol.lisp.

Direct superclasses

removed-a-value.

Condition: removed-a-value
Package

function-cache.

Source

protocol.lisp.

Direct superclasses

cache-value-condition.

Direct subclasses

expired-a-value.

Direct methods
Direct slots
Slot: removed-at
Initform

(quote (get-universal-time))

Initargs

:removed-at

Readers

removed-at.

Writers

(setf removed-at).


6.2.5 Structures

Structure: cnode
Package

function-cache.

Source

ordered.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: cache-key
Readers

cnode-cache-key.

Writers

(setf cnode-cache-key).

Slot: result
Readers

cnode-result.

Writers

(setf cnode-result).

Slot: older
Type

function-cache::cache-node

Readers

cnode-older.

Writers

(setf cnode-older).

Slot: newer
Type

function-cache::cache-node

Readers

cnode-newer.

Writers

(setf cnode-newer).


6.2.6 Classes

Class: function-cache

an object that contains the cached results of function calls
the original function to be run, to set cached values
and other cache configuration parameters. This class is mostly intended to be abstract with hash-table-function-cache, and thunk-cache being the current concrete classes

Package

function-cache.

Source

function-cache.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: cached-results
Initargs

:cached-results

Readers

cached-results.

Writers

(setf cached-results).

Slot: timeout
Initargs

:timeout

Readers

timeout.

Writers

(setf timeout).

Slot: body-fn
Initargs

:body-fn

Readers

body-fn.

Writers

(setf body-fn).

Slot: name
Initargs

:name

Readers

name.

Writers

(setf name).

Slot: lambda-list
Initargs

:lambda-list

Readers

lambda-list.

Writers

(setf lambda-list).

Slot: shared-results?
Initargs

:shared-results?

Readers

shared-results?.

Writers

(setf shared-results?).

Class: metered-hash-table-cache

cache backed by a hash-table, keeps metrics

Package

function-cache.

Source

hash-table.lisp.

Direct superclasses
Class: ordered-cache-mixin

Mixin that keeps track of the order of cached results in a doubly linked list. FIRST references the oldest cached result, and LAST references the most recent.

Package

function-cache.

Source

ordered.lisp.

Direct superclasses

cache-capacity-mixin.

Direct subclasses
Direct methods
Direct slots
Slot: oldest
Type

function-cache::cache-node

Readers

oldest-node.

Writers

(setf oldest-node).

Slot: newest
Type

function-cache::cache-node

Readers

newest-node.

Writers

(setf newest-node).


6.2.7 Types

Type: cache-node ()
Package

function-cache.

Source

ordered.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   R   S   T   V  
Index Entry  Section

%
%add-cached-node: Private ordinary functions
%call-list-for-lambda-list: Private ordinary functions
%ensure-unquoted: Private ordinary functions
%insert-into-cache: Private ordinary functions
%move-cached-node: Private ordinary functions
%remove-cached-node: Private ordinary functions

(
(setf body-fn): Private generic functions
(setf body-fn): Private generic functions
(setf cache): Private generic functions
(setf cache): Private generic functions
(setf cached-at): Private generic functions
(setf cached-at): Private generic functions
(setf cached-results): Public generic functions
(setf cached-results): Public generic functions
(setf capacity): Public generic functions
(setf capacity): Public generic functions
(setf cnode-cache-key): Private ordinary functions
(setf cnode-newer): Private ordinary functions
(setf cnode-older): Private ordinary functions
(setf cnode-result): Private ordinary functions
(setf get-cached-value): Public generic functions
(setf get-cached-value): Public generic functions
(setf get-cached-value): Public generic functions
(setf get-cached-value): Public generic functions
(setf get-cached-value): Public generic functions
(setf get-cached-value): Public generic functions
(setf get-cached-value): Public generic functions
(setf hash-init-args): Private generic functions
(setf hash-init-args): Private generic functions
(setf hits): Public generic functions
(setf hits): Public generic functions
(setf key): Private generic functions
(setf key): Private generic functions
(setf lambda-list): Private generic functions
(setf lambda-list): Private generic functions
(setf misses): Public generic functions
(setf misses): Public generic functions
(setf name): Private generic functions
(setf name): Private generic functions
(setf newest-node): Private generic functions
(setf newest-node): Private generic functions
(setf oldest-node): Private generic functions
(setf oldest-node): Private generic functions
(setf reduce-by-ratio): Public generic functions
(setf reduce-by-ratio): Public generic functions
(setf removed-at): Private generic functions
(setf removed-at): Private generic functions
(setf shared-results?): Private generic functions
(setf shared-results?): Private generic functions
(setf test): Private generic functions
(setf test): Private generic functions
(setf timeout): Public generic functions
(setf timeout): Public generic functions
(setf value): Private generic functions
(setf value): Private generic functions

A
accesses: Public ordinary functions
at-cache-capacity?: Public generic functions
at-cache-capacity?: Public generic functions
at-cache-capacity?: Public generic functions

B
body-fn: Private generic functions
body-fn: Private generic functions

C
cache: Private generic functions
cache: Private generic functions
cached-at: Private generic functions
cached-at: Private generic functions
cached-results: Public generic functions
cached-results: Public generic functions
cached-results: Public generic functions
cached-results-count: Public generic functions
cached-results-count: Public generic functions
cached-results-count: Public generic functions
cached-results-count: Public generic functions
cached-results-count: Public generic functions
cached-results-count: Public generic functions
cached-results-count: Public generic functions
cacher: Private generic functions
cacher: Private generic functions
capacity: Public generic functions
capacity: Public generic functions
clear-all-caches: Public ordinary functions
clear-cache: Public generic functions
clear-cache: Public generic functions
clear-cache: Public generic functions
clear-cache: Public generic functions
clear-cache: Public generic functions
clear-cache: Public generic functions
clear-cache-all-function-caches: Public ordinary functions
clear-cache-partial-arguments: Public generic functions
clear-cache-partial-arguments: Public generic functions
clear-cache-partial-arguments: Public generic functions
cnode: Private ordinary functions
cnode-cache-key: Private ordinary functions
cnode-newer: Private ordinary functions
cnode-older: Private ordinary functions
cnode-p: Private ordinary functions
cnode-result: Private ordinary functions
compute-cache-key: Public generic functions
compute-cache-key: Public generic functions
copy-cnode: Private ordinary functions

D
default-cache-class: Private generic functions
default-cache-class: Private generic functions
defcached: Public macros
defcached-hashkey: Public generic functions
defcached-hashkey: Public generic functions
do-caches: Private ordinary functions

E
expired?: Private generic functions
expired?: Private generic functions

F
find-function-cache-for-name: Public ordinary functions
Function, %add-cached-node: Private ordinary functions
Function, %call-list-for-lambda-list: Private ordinary functions
Function, %ensure-unquoted: Private ordinary functions
Function, %insert-into-cache: Private ordinary functions
Function, %move-cached-node: Private ordinary functions
Function, %remove-cached-node: Private ordinary functions
Function, (setf cnode-cache-key): Private ordinary functions
Function, (setf cnode-newer): Private ordinary functions
Function, (setf cnode-older): Private ordinary functions
Function, (setf cnode-result): Private ordinary functions
Function, accesses: Public ordinary functions
Function, clear-all-caches: Public ordinary functions
Function, clear-cache-all-function-caches: Public ordinary functions
Function, cnode: Private ordinary functions
Function, cnode-cache-key: Private ordinary functions
Function, cnode-newer: Private ordinary functions
Function, cnode-older: Private ordinary functions
Function, cnode-p: Private ordinary functions
Function, cnode-result: Private ordinary functions
Function, copy-cnode: Private ordinary functions
Function, do-caches: Private ordinary functions
Function, find-function-cache-for-name: Public ordinary functions
Function, get-cached-object-stats: Private ordinary functions
Function, hit-ratio: Public ordinary functions
Function, incf-hash: Private ordinary functions
Function, number-to-remove: Private ordinary functions
Function, purge-all-caches: Public ordinary functions
Function, sync-ordered-cache: Private ordinary functions

G
Generic Function, (setf body-fn): Private generic functions
Generic Function, (setf cache): Private generic functions
Generic Function, (setf cached-at): Private generic functions
Generic Function, (setf cached-results): Public generic functions
Generic Function, (setf capacity): Public generic functions
Generic Function, (setf get-cached-value): Public generic functions
Generic Function, (setf hash-init-args): Private generic functions
Generic Function, (setf hits): Public generic functions
Generic Function, (setf key): Private generic functions
Generic Function, (setf lambda-list): Private generic functions
Generic Function, (setf misses): Public generic functions
Generic Function, (setf name): Private generic functions
Generic Function, (setf newest-node): Private generic functions
Generic Function, (setf oldest-node): Private generic functions
Generic Function, (setf reduce-by-ratio): Public generic functions
Generic Function, (setf removed-at): Private generic functions
Generic Function, (setf shared-results?): Private generic functions
Generic Function, (setf test): Private generic functions
Generic Function, (setf timeout): Public generic functions
Generic Function, (setf value): Private generic functions
Generic Function, at-cache-capacity?: Public generic functions
Generic Function, body-fn: Private generic functions
Generic Function, cache: Private generic functions
Generic Function, cached-at: Private generic functions
Generic Function, cached-results: Public generic functions
Generic Function, cached-results-count: Public generic functions
Generic Function, cacher: Private generic functions
Generic Function, capacity: Public generic functions
Generic Function, clear-cache: Public generic functions
Generic Function, clear-cache-partial-arguments: Public generic functions
Generic Function, compute-cache-key: Public generic functions
Generic Function, default-cache-class: Private generic functions
Generic Function, defcached-hashkey: Public generic functions
Generic Function, expired?: Private generic functions
Generic Function, get-cached-value: Public generic functions
Generic Function, hash-init-args: Private generic functions
Generic Function, hits: Public generic functions
Generic Function, key: Private generic functions
Generic Function, key-cached?: Private generic functions
Generic Function, lambda-list: Private generic functions
Generic Function, make-cache-backing: Private generic functions
Generic Function, misses: Public generic functions
Generic Function, name: Private generic functions
Generic Function, newest-node: Private generic functions
Generic Function, oldest-node: Private generic functions
Generic Function, partial-argument-match?: Public generic functions
Generic Function, purge-cache: Public generic functions
Generic Function, reduce-by-ratio: Public generic functions
Generic Function, reduce-cached-set: Public generic functions
Generic Function, removed-at: Private generic functions
Generic Function, reset-counters: Public generic functions
Generic Function, shared-results?: Private generic functions
Generic Function, test: Private generic functions
Generic Function, timeout: Public generic functions
Generic Function, value: Private generic functions
get-cached-object-stats: Private ordinary functions
get-cached-value: Public generic functions
get-cached-value: Public generic functions
get-cached-value: Public generic functions
get-cached-value: Public generic functions
get-cached-value: Public generic functions
get-cached-value: Public generic functions

H
hash-init-args: Private generic functions
hash-init-args: Private generic functions
hit-ratio: Public ordinary functions
hits: Public generic functions
hits: Public generic functions

I
incf-hash: Private ordinary functions
initialize-instance: Public standalone methods

K
key: Private generic functions
key: Private generic functions
key-cached?: Private generic functions
key-cached?: Private generic functions
key-cached?: Private generic functions
key-cached?: Private generic functions
key-cached?: Private generic functions

L
lambda-list: Private generic functions
lambda-list: Private generic functions

M
Macro, defcached: Public macros
make-cache-backing: Private generic functions
make-cache-backing: Private generic functions
make-cache-backing: Private generic functions
make-cache-backing: Private generic functions
Method, (setf body-fn): Private generic functions
Method, (setf cache): Private generic functions
Method, (setf cached-at): Private generic functions
Method, (setf cached-results): Public generic functions
Method, (setf capacity): Public generic functions
Method, (setf get-cached-value): Public generic functions
Method, (setf get-cached-value): Public generic functions
Method, (setf get-cached-value): Public generic functions
Method, (setf get-cached-value): Public generic functions
Method, (setf get-cached-value): Public generic functions
Method, (setf get-cached-value): Public generic functions
Method, (setf hash-init-args): Private generic functions
Method, (setf hits): Public generic functions
Method, (setf key): Private generic functions
Method, (setf lambda-list): Private generic functions
Method, (setf misses): Public generic functions
Method, (setf name): Private generic functions
Method, (setf newest-node): Private generic functions
Method, (setf oldest-node): Private generic functions
Method, (setf reduce-by-ratio): Public generic functions
Method, (setf removed-at): Private generic functions
Method, (setf shared-results?): Private generic functions
Method, (setf test): Private generic functions
Method, (setf timeout): Public generic functions
Method, (setf value): Private generic functions
Method, at-cache-capacity?: Public generic functions
Method, at-cache-capacity?: Public generic functions
Method, body-fn: Private generic functions
Method, cache: Private generic functions
Method, cached-at: Private generic functions
Method, cached-results: Public generic functions
Method, cached-results: Public generic functions
Method, cached-results-count: Public generic functions
Method, cached-results-count: Public generic functions
Method, cached-results-count: Public generic functions
Method, cached-results-count: Public generic functions
Method, cached-results-count: Public generic functions
Method, cached-results-count: Public generic functions
Method, cacher: Private generic functions
Method, capacity: Public generic functions
Method, clear-cache: Public generic functions
Method, clear-cache: Public generic functions
Method, clear-cache: Public generic functions
Method, clear-cache: Public generic functions
Method, clear-cache: Public generic functions
Method, clear-cache-partial-arguments: Public generic functions
Method, clear-cache-partial-arguments: Public generic functions
Method, compute-cache-key: Public generic functions
Method, default-cache-class: Private generic functions
Method, defcached-hashkey: Public generic functions
Method, expired?: Private generic functions
Method, get-cached-value: Public generic functions
Method, get-cached-value: Public generic functions
Method, get-cached-value: Public generic functions
Method, get-cached-value: Public generic functions
Method, get-cached-value: Public generic functions
Method, hash-init-args: Private generic functions
Method, hits: Public generic functions
Method, initialize-instance: Public standalone methods
Method, key: Private generic functions
Method, key-cached?: Private generic functions
Method, key-cached?: Private generic functions
Method, key-cached?: Private generic functions
Method, key-cached?: Private generic functions
Method, lambda-list: Private generic functions
Method, make-cache-backing: Private generic functions
Method, make-cache-backing: Private generic functions
Method, make-cache-backing: Private generic functions
Method, misses: Public generic functions
Method, name: Private generic functions
Method, newest-node: Private generic functions
Method, oldest-node: Private generic functions
Method, partial-argument-match?: Public generic functions
Method, print-object: Public standalone methods
Method, purge-cache: Public generic functions
Method, purge-cache: Public generic functions
Method, purge-cache: Public generic functions
Method, purge-cache: Public generic functions
Method, purge-cache: Public generic functions
Method, purge-cache: Public generic functions
Method, reduce-by-ratio: Public generic functions
Method, reduce-cached-set: Public generic functions
Method, reduce-cached-set: Public generic functions
Method, reduce-cached-set: Public generic functions
Method, removed-at: Private generic functions
Method, reset-counters: Public generic functions
Method, reset-counters: Public generic functions
Method, shared-results?: Private generic functions
Method, test: Private generic functions
Method, timeout: Public generic functions
Method, value: Private generic functions
misses: Public generic functions
misses: Public generic functions

N
name: Private generic functions
name: Private generic functions
newest-node: Private generic functions
newest-node: Private generic functions
number-to-remove: Private ordinary functions

O
oldest-node: Private generic functions
oldest-node: Private generic functions

P
partial-argument-match?: Public generic functions
partial-argument-match?: Public generic functions
print-object: Public standalone methods
purge-all-caches: Public ordinary functions
purge-cache: Public generic functions
purge-cache: Public generic functions
purge-cache: Public generic functions
purge-cache: Public generic functions
purge-cache: Public generic functions
purge-cache: Public generic functions
purge-cache: Public generic functions

R
reduce-by-ratio: Public generic functions
reduce-by-ratio: Public generic functions
reduce-cached-set: Public generic functions
reduce-cached-set: Public generic functions
reduce-cached-set: Public generic functions
reduce-cached-set: Public generic functions
removed-at: Private generic functions
removed-at: Private generic functions
reset-counters: Public generic functions
reset-counters: Public generic functions
reset-counters: Public generic functions

S
shared-results?: Private generic functions
shared-results?: Private generic functions
sync-ordered-cache: Private ordinary functions

T
test: Private generic functions
test: Private generic functions
timeout: Public generic functions
timeout: Public generic functions

V
value: Private generic functions
value: Private generic functions


A.3 Variables

Jump to:   *  
B   C   H   K   L   M   N   O   R   S   T   V  
Index Entry  Section

*
*bypass-cache*: Public special variables
*cache*: Private special variables
*cache-names*: Public special variables
*cached-at*: Private special variables
*default-cache-class*: Public special variables
*default-hash-init-args*: Private special variables

B
body-fn: Private classes

C
cache: Private conditions
cache-key: Private structures
cached-at: Private conditions
cached-results: Private classes
capacity: Public classes

H
hash-init-args: Public classes
hits: Public classes

K
key: Private conditions

L
lambda-list: Private classes

M
misses: Public classes

N
name: Private classes
newer: Private structures
newest: Private classes

O
older: Private structures
oldest: Private classes

R
reduce-by-ratio: Public classes
removed-at: Private conditions
result: Private structures

S
shared-results?: Private classes
Slot, body-fn: Private classes
Slot, cache: Private conditions
Slot, cache-key: Private structures
Slot, cached-at: Private conditions
Slot, cached-results: Private classes
Slot, capacity: Public classes
Slot, hash-init-args: Public classes
Slot, hits: Public classes
Slot, key: Private conditions
Slot, lambda-list: Private classes
Slot, misses: Public classes
Slot, name: Private classes
Slot, newer: Private structures
Slot, newest: Private classes
Slot, older: Private structures
Slot, oldest: Private classes
Slot, reduce-by-ratio: Public classes
Slot, removed-at: Private conditions
Slot, result: Private structures
Slot, shared-results?: Private classes
Slot, test: Public classes
Slot, timeout: Private classes
Slot, value: Private conditions
Special Variable, *bypass-cache*: Public special variables
Special Variable, *cache*: Private special variables
Special Variable, *cache-names*: Public special variables
Special Variable, *cached-at*: Private special variables
Special Variable, *default-cache-class*: Public special variables
Special Variable, *default-hash-init-args*: Private special variables

T
test: Public classes
timeout: Private classes

V
value: Private conditions


A.4 Data types

Jump to:   C   E   F   H   L   M   O   P   R   S   T  
Index Entry  Section

C
cache-capacity-mixin: Public classes
cache-node: Private types
cache-value-condition: Private conditions
cache.lisp: The function-cache/src/cache․lisp file
cached-a-value: Private conditions
capacity.lisp: The function-cache/src/capacity․lisp file
Class, cache-capacity-mixin: Public classes
Class, function-cache: Private classes
Class, hash-table-function-cache: Public classes
Class, hash-table-function-cache-with-capacity: Public classes
Class, lru-cache: Public classes
Class, metered-hash-table-cache: Private classes
Class, metered-mixin: Public classes
Class, mru-cache: Public classes
Class, ordered-cache-mixin: Private classes
Class, single-cell-function-cache: Public classes
Class, thunk-cache: Public classes
cnode: Private structures
Condition, cache-value-condition: Private conditions
Condition, cached-a-value: Private conditions
Condition, expired-a-value: Private conditions
Condition, removed-a-value: Private conditions

E
expired-a-value: Private conditions

F
File, cache.lisp: The function-cache/src/cache․lisp file
File, capacity.lisp: The function-cache/src/capacity․lisp file
File, function-cache.asd: The function-cache/function-cache․asd file
File, function-cache.lisp: The function-cache/src/function-cache․lisp file
File, hash-table.lisp: The function-cache/src/hash-table․lisp file
File, metering.lisp: The function-cache/src/metering․lisp file
File, ordered.lisp: The function-cache/src/ordered․lisp file
File, packages.lisp: The function-cache/src/packages․lisp file
File, protocol.lisp: The function-cache/src/protocol․lisp file
File, single-cell.lisp: The function-cache/src/single-cell․lisp file
File, thunk.lisp: The function-cache/src/thunk․lisp file
function-cache: The function-cache system
function-cache: The function-cache package
function-cache: Private classes
function-cache-system: The function-cache-system package
function-cache.asd: The function-cache/function-cache․asd file
function-cache.lisp: The function-cache/src/function-cache․lisp file

H
hash-table-function-cache: Public classes
hash-table-function-cache-with-capacity: Public classes
hash-table.lisp: The function-cache/src/hash-table․lisp file

L
lru-cache: Public classes

M
metered-hash-table-cache: Private classes
metered-mixin: Public classes
metering.lisp: The function-cache/src/metering․lisp file
Module, src: The function-cache/src module
mru-cache: Public classes

O
ordered-cache-mixin: Private classes
ordered.lisp: The function-cache/src/ordered․lisp file

P
Package, function-cache: The function-cache package
Package, function-cache-system: The function-cache-system package
packages.lisp: The function-cache/src/packages․lisp file
protocol.lisp: The function-cache/src/protocol․lisp file

R
removed-a-value: Private conditions

S
single-cell-function-cache: Public classes
single-cell.lisp: The function-cache/src/single-cell․lisp file
src: The function-cache/src module
Structure, cnode: Private structures
System, function-cache: The function-cache system

T
thunk-cache: Public classes
thunk.lisp: The function-cache/src/thunk․lisp file
Type, cache-node: Private types