HASH TABLE FUNCTIONS
A hash table is implemented as an structure of type hash-table. No general accessing functions are provided, and hash tables print out using the angle bracket convention (not readable by READ). The first element is the comparison function. The remaining elements contain association lists of keys (that hash to the same value) and their data.
MAKE A HASH TABLE
(make-hash-table &key :size :test)
- :size size of hash table -- should be a prime number. Default is 31.
- :test comparison function. Defaults to eql.
- returns the hash table
EXTRACT FROM HASH TABLE
(gethash <key> <table> [<def>])
See also gethash in SETF.
- <key> hash key
- <table> hash table
- <def> value to return on no match (default is NIL)
- returns associated data, if found, or <def> if not found.
DELETE FROM HASH TABLE
(remhash <key> <table>)
- <key> hash key
- <table> hash table
- returns T if deleted, NIL if not in table
CLEAR THE HASH TABLE
(clrhash <table>)
- <table> hash table
- returns NIL, all entries cleared from table
NUMBER OF ENTRIES IN HASH TABLE
(hash-table-count <table>)
- <table> hash table
- returns integer number of entries in table
MAP FUNCTION OVER TABLE ENTRIES
(maphash <fcn> <table>)
- <fcn> the function or function name, a function of two arguments, the first is bound to the key, and the second the value of each table entry in turn.
- <table> hash table
- returns NIL
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker