Next: srfi hash-tables spec whole, Previous: srfi hash-tables spec queries, Up: srfi hash-tables spec [Index]
This procedure returns the value associated to key in hash-table. If no value is associated to key and thunk is given, it is called with no arguments and its value is returned; if thunk is not given, an error is signalled.
Given a good hash function, this operation should have an (amortised) complexity of O(1) with respect to the number of associations in hash-table.
NOTE This rules out implementation by association lists or fixed–length hash tables.
Evaluate to the same value as:
(hash-table-ref hash-table key (lambda () default))
Given a good hash function, this operation should have an (amortised) complexity of O(1) with respect to the number of associations in hash-table.
NOTE This rules out implementation by association lists or fixed–length hash tables.
Set the value associated to key in hash-table. The previous association (if any) is removed.
Given a good hash function, this operation should have an (amortised) complexity of O(1) with respect to the number of associations in hash-table.
NOTE This rules out implementation by association lists or fixed–length hash tables.
Remove any association to key in hash-table. It is not an error if no association for that key exists; in this case, nothing is done.
Given a good hash function, this operation should have an (amortised) complexity of O(1) with respect to the number of associations in hash-table.
NOTE This rules out implementation by association lists or fixed–length hash tables.
Tell whether there is any association to key in hash-table; return a boolean.
Given a good hash function, this operation should have an (amortised) complexity of O(1) with respect to the number of associations in hash-table.
NOTE This rules out implementation by association lists or fixed–length hash tables.
Semantically equivalent to, but may be implemented more efficiently than, the following code:
(hash-table-set! hash-table key (function (hash-table-ref hash-table key thunk)))
Behave as if it evaluates to:
(hash-table-update! hash-table key function (lambda () default))
Next: srfi hash-tables spec whole, Previous: srfi hash-tables spec queries, Up: srfi hash-tables spec [Index]