— Function: **predicate->hash**` pred`

Returns a hash function (like

`hashq`

,`hashv`

, or`hash`

) corresponding to the equality predicatepred.predshould be`eq?`

,`eqv?`

,`equal?`

,`=`

,`char=?`

,`char-ci=?`

,`string=?`

, or`string-ci=?`

.

A hash table is a vector of association lists.

Hash table functions provide utilities for an associative database.
These functions take an equality predicate, `pred`, as an argument.
`pred` should be `eq?`

, `eqv?`

, `equal?`

, `=`

,
`char=?`

, `char-ci=?`

, `string=?`

, or
`string-ci=?`

.

— Function: **predicate->hash-asso**` pred`

Returns a hash association function of 2 arguments,

keyandhashtab, corresponding topred. The returned function returns a key-value pair whose key ispred-equal to its first argument or`#f`

if no key inhashtabispred-equal to the first argument.

— Function: **hash-inquirer**` pred`

Returns a procedure of 2 arguments,

hashtabandkey, which returns the value associated withkeyinhashtabor`#f`

ifkeydoes not appear inhashtab.

— Function: **hash-associator**` pred`

Returns a procedure of 3 arguments,

hashtab,key, andvalue, which modifieshashtabso thatkeyandvalueassociated. Any previous value associated withkeywill be lost.

— Function: **hash-remover**` pred`

Returns a procedure of 2 arguments,

hashtabandkey, which modifieshashtabso that the association whose key iskeyis removed.

— Function: **hash-map**` proc hash-table`

Returns a new hash table formed by mapping

procover the keys and values ofhash-table.procmust be a function of 2 arguments which returns the new value part.

— Function: **hash-for-each**` proc hash-table`

Applies

procto each pair of keys and values ofhash-table.procmust be a function of 2 arguments. The returned value is unspecified.

— Function: **hash-rehasher**` pred`

`hash-rehasher`

accepts a hash table predicate and returns a function of two argumentshashtabandnew-kwhich is specialized for that predicate.This function is used for nondestrutively resizing a hash table.

hashtabshould be an existing hash-table usingpred,new-kis the size of a new hash table to be returned. The new hash table will have all of the associations of the old hash table.