The cl-cache-tables Reference Manual

This is the cl-cache-tables Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:43:01 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-cache-tables

A wrapper around native hash-tables to facilitate
in-process caching of common lisp data structures.

Author

Diogo Franco

License

MIT

Version

0.0.1

Source

cl-cache-tables.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 cl-cache-tables/cl-cache-tables.asd

Source

cl-cache-tables.asd.

Parent Component

cl-cache-tables (system).

ASDF Systems

cl-cache-tables.


3.1.2 cl-cache-tables/package.lisp

Source

cl-cache-tables.asd.

Parent Component

cl-cache-tables (system).

Packages

cache.


3.1.3 cl-cache-tables/cl-cache-tables.lisp

Dependency

package.lisp (file).

Source

cl-cache-tables.asd.

Parent Component

cl-cache-tables (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cache

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: cache-table-count (cache-table)

Returns the number of elements in cache-table. A cleared or new cache-table returns 0.

Package

cache.

Source

cl-cache-tables.lisp.

Function: cache-table-del (key cache-table)

Deletes key from cache-table. Returns t if the key existed, nil otherwise.

Package

cache.

Source

cl-cache-tables.lisp.

Function: cache-table-get (key cache-table)

Returns the value at key in cache-table. Also returns a second value that is T if the key exists, and nil if it doesn’t or has expired.

Package

cache.

Source

cl-cache-tables.lisp.

Function: cache-table-get-or-fill (key cache-table fun &key expire)

Retrieves key from cache table, similarly to cache-table-get.
When the key is not present, function is called with the key argument, to compute/retrieve it from another source. cache-table is then populated with the result and expiration of "expire" seconds. Returns the value
of key. Notice that when function returns nil, that value becomes cached as any other value, so if you want to signal that some value couldn’t be found, your function should throw an error

Package

cache.

Source

cl-cache-tables.lisp.

Function: cache-table-p (object)
Package

cache.

Source

cl-cache-tables.lisp.

Function: cache-table-persist (key cache-table)

Removes the expiration from a key. Returns nil if key did not exist, and nil otherwise.

Package

cache.

Source

cl-cache-tables.lisp.

Function: cache-table-put (key value cache-table &key expire)

Sets key and value in cache-table. Expire is in seconds and defaults to 0, which means that this key will never expire. Returns value.

Package

cache.

Source

cl-cache-tables.lisp.

Function: cache-table-ttl (key cache-table)

Returns the time to live (in seconds) of the key in cache-table.
If the key is persistent, returns -1. If it does not exist, returns nil.

Package

cache.

Source

cl-cache-tables.lisp.

Function: clrcache (cache-table)

Removes all entries from cache-table and returns that empty cache-table.

Package

cache.

Source

cl-cache-tables.lisp.

Function: copy-cache-table (cache-table)

Creates a new cache-table equal to cache-table and returns it.

Package

cache.

Source

cl-cache-tables.lisp.

Function: make-cache-table (&key test rehash-size rehash-threshold size)
Package

cache.

Source

cl-cache-tables.lisp.

Function: mapcache (function cache-table)

Calls fun for every existing and non-expired key value pair in cache-table. Similarly to maphash, returns nil.

Package

cache.

Source

cl-cache-tables.lisp.


5.2 Internals


5.2.1 Ordinary functions

Reader: cache-table-hash (instance)
Writer: (setf cache-table-hash) (instance)
Package

cache.

Source

cl-cache-tables.lisp.

Target Slot

hash.

Reader: cache-table-rehash-size (instance)
Writer: (setf cache-table-rehash-size) (instance)
Package

cache.

Source

cl-cache-tables.lisp.

Target Slot

rehash-size.

Reader: cache-table-rehash-threshold (instance)
Writer: (setf cache-table-rehash-threshold) (instance)
Package

cache.

Source

cl-cache-tables.lisp.

Target Slot

rehash-threshold.

Reader: cache-table-size (instance)
Writer: (setf cache-table-size) (instance)
Package

cache.

Source

cl-cache-tables.lisp.

Target Slot

size.

Reader: cache-table-test (instance)
Writer: (setf cache-table-test) (instance)
Package

cache.

Source

cl-cache-tables.lisp.

Target Slot

test.

Function: copy-hash-table (hash-table)

Helper function that copies a hash table.

Package

cache.

Source

cl-cache-tables.lisp.


5.2.2 Structures

Structure: cache-table
Package

cache.

Source

cl-cache-tables.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: test
Readers

cache-table-test.

Writers

(setf cache-table-test).

Slot: size
Readers

cache-table-size.

Writers

(setf cache-table-size).

Slot: rehash-size
Readers

cache-table-rehash-size.

Writers

(setf cache-table-rehash-size).

Slot: rehash-threshold
Readers

cache-table-rehash-threshold.

Writers

(setf cache-table-rehash-threshold).

Slot: hash
Readers

cache-table-hash.

Writers

(setf cache-table-hash).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   F   M  
Index Entry  Section

(
(setf cache-table-hash): Private ordinary functions
(setf cache-table-rehash-size): Private ordinary functions
(setf cache-table-rehash-threshold): Private ordinary functions
(setf cache-table-size): Private ordinary functions
(setf cache-table-test): Private ordinary functions

C
cache-table-count: Public ordinary functions
cache-table-del: Public ordinary functions
cache-table-get: Public ordinary functions
cache-table-get-or-fill: Public ordinary functions
cache-table-hash: Private ordinary functions
cache-table-p: Public ordinary functions
cache-table-persist: Public ordinary functions
cache-table-put: Public ordinary functions
cache-table-rehash-size: Private ordinary functions
cache-table-rehash-threshold: Private ordinary functions
cache-table-size: Private ordinary functions
cache-table-test: Private ordinary functions
cache-table-ttl: Public ordinary functions
clrcache: Public ordinary functions
copy-cache-table: Public ordinary functions
copy-hash-table: Private ordinary functions

F
Function, (setf cache-table-hash): Private ordinary functions
Function, (setf cache-table-rehash-size): Private ordinary functions
Function, (setf cache-table-rehash-threshold): Private ordinary functions
Function, (setf cache-table-size): Private ordinary functions
Function, (setf cache-table-test): Private ordinary functions
Function, cache-table-count: Public ordinary functions
Function, cache-table-del: Public ordinary functions
Function, cache-table-get: Public ordinary functions
Function, cache-table-get-or-fill: Public ordinary functions
Function, cache-table-hash: Private ordinary functions
Function, cache-table-p: Public ordinary functions
Function, cache-table-persist: Public ordinary functions
Function, cache-table-put: Public ordinary functions
Function, cache-table-rehash-size: Private ordinary functions
Function, cache-table-rehash-threshold: Private ordinary functions
Function, cache-table-size: Private ordinary functions
Function, cache-table-test: Private ordinary functions
Function, cache-table-ttl: Public ordinary functions
Function, clrcache: Public ordinary functions
Function, copy-cache-table: Public ordinary functions
Function, copy-hash-table: Private ordinary functions
Function, make-cache-table: Public ordinary functions
Function, mapcache: Public ordinary functions

M
make-cache-table: Public ordinary functions
mapcache: Public ordinary functions