/tg/ Station 13 - Modules - Types — Var Details - Proc Details

bulge_bounded_cache

A cache of at most limit entries that drops the oldest first. A dropped entry only costs its computation again.

Vars

cursorWhere the next key goes once the cache is full: the oldest.
entriesKey -> value. Lazy.
keysKeys in the order they were stored, for dropping the oldest. Lazy.
limitMost entries kept.

Procs

clearEmpties the cache.
fetchThe value stored for key, or null.
store_valueStores value for key unless one is stored already, and returns the stored one.

Var Details

cursor

Where the next key goes once the cache is full: the oldest.

entries

Key -> value. Lazy.

keys

Keys in the order they were stored, for dropping the oldest. Lazy.

limit

Most entries kept.

Proc Details

clear

Empties the cache.

fetch

The value stored for key, or null.

store_value

Stores value for key unless one is stored already, and returns the stored one.