(index ("make-sfht" 0))
(def (sig (procedure "make-sfht:: N P MAKE-RNG-STATE RANDOM! KEY->VECTOR KEY-VECTOR-REF KEY-VECTOR-LENGTH [KEY-EQUAL?] -> <SFHT>" (id make-sfht))) (p "where") (dl (dt (tt "MAKE-RNG-STATE")) (dd "is a user-supplied function that takes in an integer argument and returns an RNG state value. ") (dt (tt "RANDOM!")) (dd "is a user-supplied function that generates a random positive integer, given a state value, which is expected to be mutated. ") (dt (tt "KEY->VECTOR")) (dd "is a user-supplied function that takes a key value and returns a vector.") (dt (tt "KEY-VECTOR-REF")) (dd "is a user-supplied function that retrieves an element from the vector returned by " (tt "KEY-VECTOR") ". ") (dt (tt "KEY-VECTOR-LENGTH")) (dd "is a user-supplied function that returns the length of the key vector.") (dt (tt "KEY->EQUAL?")) (dd "is a user-supplied predicate that takes two keys and returns " (tt "#t") " if they are equal. The default function used is " (tt "equal?"))) (p "The " (tt "SFHT") " typeclass consists of the following methods:") (dl (dt (tt "empty")) (dd "creates a new empty hash table") (dt (tt "get")) (dd "procedure of the form " (tt "SFHT KEY . DEFAULT-CLAUSE") " which searches the hash table for an association with a given " (tt "KEY") ", and returns a (key . value) pair of the found association. If an association with " (tt "KEY") " cannot be located in the hash table, the PROC returns the result of evaluating the " (tt "DEFAULT-CLAUSE") ". If the default clause is omitted, an error is signaled. " (tt "KEY") " must be comparable to the keys in the hash table by the " (tt "KEY-EQUAL?") " predicate specified when the hash table was created)") (dt (tt "empty?")) (dd "returns " (tt "#t") " if the hash table is empty") (dt (tt "size")) (dd "returns the size (the number of associations) in the hash table") (dt (tt "clear!")) (dd "removes all associations from the hash table (thus making it empty)") (dt (tt "put!")) (dd "procedure of the form " (tt "SFHT KEY VALUE") " which, given a " (tt "KEY") " and a " (tt "VALUE") ", adds the corresponding association to the hash table. If an association with the same " (tt "KEY") " already exists, its value is replaced with the " (tt "VALUE") ". The return value is " (tt "#f") ".") (dt (tt "delete!")) (dd "procedure of the form " (tt "SFHT KEY . DEFAULT-CLAUSE") " which searches the hash table for an association with a given " (tt "KEY") ", deletes it, and returns a (key . value) pair of the found and deleted association. If an association with the KEY cannot be located in the hash table, the " (tt "PROC") " returns the result of evaluating " (tt "DEFAULT-CLAUSE") ". If the default clause is omitted, an error is signaled. ")))
