chickadee » lru-cache » lru-cache-set!

lru-cache-set! cache key valprocedure

Add an item into the cache which associates key with val, or if an item matching key already exists, updates the item to the new val. If the key did not exist, the item is marked as the most-recently used. If the key did exist, the LRU ordering behavior is undefined; currently -- and don't take this for granted -- the LRU order is not updated.

If adding this item causes the cache to exceed its capacity, the least-recently used item is deleted, and consequently the deleter (if provided) is invoked. If the deleter throws an exception, the item remains in the cache, and the new item is not added.