Next: Foreign function interface, Up: Scheme reference [Contents][Index]
There are many mutable hashtable APIs amongst all the various Scheme
implementations, standards, and SRFIs. From our point of view, there
is no clear “best” hashtable API that has emerged, but we think the
R6RS interface is OK. Guile’s own hashtable API has design issues
that are best left in the past. So, the (hoot hashtables)
module is R6RS-like.
Currently, this interface supports keys hashed by object identity
(eq?
) only. The object equivalence (eqv?
) and deep
object equality (equal?
) hashing strategies are not yet
implemented.
Return a new, empty hash table.
Return #t
if obj
Return the number of key/value pairs in hashtable.
Return the value associated with key in hashtable or default if there is no such association.
Modify hashtable to associate key with value, overwriting any previous association that may have existed.
Remove the association with key in hashtable, if one exists.
Remove all of the key/value associations in hashtable.
Return #t
if key has an associated value in
hashtable.
Return a copy of hashtable.
Return a vector of keys in hashtable.
Return a vector of values in hashtable.
For each key/value pair in hashtable, call proc with two arguments: the key and the value.
Hoot also includes weak key hash tables that wrap those of the Wasm
host platform, such as the WeakMap
JavaScript class on the web.
Return a new weak key hashtable.
Return #t
if obj is a weak key hashtable.
Return the value associated with key in hashtable or default if there is no such association.
Modify hashtable to associate key with value, overwriting any previous association that may have existed.
Remove the association with key in hashtable, if one exists.
Next: Foreign function interface, Up: Scheme reference [Contents][Index]