-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
46 lines (34 loc) · 1.65 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
NET.HEXAPODIA.HASHTABLES
Generic hash table implementation. This implementation is in the
public domain.
Written by Ingvar Mattsson <[email protected]>.
This package defines four generic functions and two normal functions.
The non-generic function MAKE-GENERIC-HASH-TABLE is used for
hash table creation.
(make-generic-hashtable (:test 'eql) (:size 17))
If this function is fed the *symbols* EQ EQL EQUAL or EQUALP as test
it will create a generic hash table with that as an equality test
and SXHASH as the hash function. NOTE: Using EQ or EQL as the test
designator is risky and should be avoided. In general, for the
built-in test designators, use the function instead of the
symbol. This will give you a built-in hash table.
If this function is fed the *functions* EQ EQL EQUAL or EQUALP
it will create a normal (built-in) hash table with that as a test
function.
(register-test-designator <nickname> <hash fn> <equal fn>)
Register a new generic hash function with <nickname> as the
relevant :test parameter.
The generic functions are:
(hashref <key> <table> &optnonal (default nil))
This function does essentially the same thing as GETHASH.
((setf hashref) <value> <key> <table> &optional ignore)
For (setf (hashref ...) ...)
(map-generic-hash <fn> <table>)
As MAPHASH
(hashrem <key> <table>)
As REMHASH
These functions dispatch somewhat differently depending on if they're
fed a generic hash table or a built-in hash table.
For benchmarking, just load "benchtests.lisp", this will loop through
the number 0 to 1000 (and 100000) and feed them into a hash table, then
generating a report of *STANDARD-OUTPUT*.