92 lines
7.9 KiB
Plaintext
92 lines
7.9 KiB
Plaintext
1
|
||
|
||
Lisp Library Modules, Medley Release 1.0, CASH-FILE
|
||
1
|
||
|
||
Lisp Library Modules, Medley Release 1.0, CASH-FILE
|
||
CASH-FILE
|
||
1
|
||
|
||
CASH-FILE
|
||
1
|
||
|
||
|
||
CASH-FILE
|
||
6
|
||
|
||
Cash-File is a front end to Hash-File which uses a hash table to cache accesses to hash files. This can provide a significant performance improvement in applications which access a small number of keys repeatedly. For example, the Where-Is library module uses this module to achieve acceptable interactive performance.
|
||
Cash-File(CASH-FILE NIL Cash-File NIL NIL 15) is similar to but not compatible with the LispUsers' module, HASHBUFFER.
|
||
All of the code for Cash-File is in a package called Cash-File. Througout this document Lisp symbols are printed as though in a package which uses the packages Cash-File, Hash-File, and Lisp.
|
||
Installation
|
||
1
|
||
|
||
Load CASH-FILE.DFASL and HASH-FILE.DFASL from the library.
|
||
Functions
|
||
1
|
||
|
||
The functional interface is designed to closely resemble that of Hash-File, which was in turn designed to resemble the Common Lisp hash table facility.
|
||
(make-cash-file(MAKE-CASH-FILE (Function) make-cash-file NIL NIL 15) file-name size cache-size) [Function]
|
||
Creates and returns an empty cash file in file-name. Size is passed as the size argument to make-hash-file, while cache-size is passed as the size argument to make-hash-table and determines the maximum number of entries to be cached.
|
||
(get-cash-file(GET-CASH-FILE (Function) get-cash-file NIL NIL 15) key cash-file &optional default) [Function]
|
||
Just like get-hash-file and gethash. Retrieves the value stored under key in cash-file or default if there is none. Also returns a second value which is true if a value was found for key.
|
||
A setf method is also defined for get-cash-file .
|
||
(open-cash-file file-name cache-size &key direction) [Function]
|
||
Open the existing hash file in file-name in direction (:input or :io). Cache-size is passed as the size argument to make-hash-table and determines the maximum number of entries which will ever be cached.
|
||
(rem-cash-file key cash-file) [Function]
|
||
Like rem-hash-file and remhash. Deletes key from the hash file and the cache. Returns true if and only if there was a value stored under key.
|
||
(cash-file-p object) [Function]
|
||
Returns true if and only if object is a cash file.
|
||
(cash-file-p object)<29><> |