Next: stdlib hashtable inspection, Previous: stdlib hashtable constructors, Up: stdlib hashtable [Index]
Return #t
if obj is a hashtable, #f
otherwise.
Return the number of keys contained in hashtable as an exact integer object.
Return the value in hashtable associated with key. If hashtable does not contain an association for key, default is returned.
As Vicare extension: when default is not used, it defaults to the sentinel object. When in doubt: we should always use the sentinel object as default argument. See The sentinel object.
Change hashtable to associate key with obj, adding a new association or replacing any existing association for key, and returns unspecified values.
As Vicare extension: if obj is (void)
an exception
is raised with condition object type
&procedure-argument-violation
; the void value is to be used
as sentinel value for hash tables.
Remove any association for key within hashtable; if there is no association for key: do nothing.
As Vicare extension return two values:
#f
and #f
.
Return #t
if hashtable contains an association for key,
#f
otherwise.
proc should accept one argument, should return a single value, and should not mutate hashtable.
The hashtable-update!
procedure applies proc to the value
in hashtable associated with key, or to default if
hashtable does not contain an association for key. The
hashtable is then changed to associate key with the value
returned by proc.
The behavior of hashtable-update!
is equivalent to the following
code, but may be implemented more efficiently in cases where the
implementation can avoid multiple lookups of the same key:
(hashtable-set! hashtable key (proc (hashtable-ref hashtable key default)))
Return a copy of hashtable. If the mutable argument is provided and is true, the returned hashtable is mutable; otherwise it is immutable.
Remove all associations from hashtable and returns unspecified values.
If a second argument is given, the current capacity of the hashtable is reset to approximately k elements.
Return a vector of all keys in hashtable. The order of the vector is unspecified.
Return two values, a vector of the keys in hashtable, and a vector of the corresponding values.
Example:
(let ((h (make-eqv-hashtable))) (hashtable-set! h 1 'one) (hashtable-set! h 2 'two) (hashtable-set! h 3 'three) (hashtable-entries h)) ⇒ #(1 2 3) #(one two three) ; two return values
the order of the entries in the result vectors is not known.
Next: stdlib hashtable inspection, Previous: stdlib hashtable constructors, Up: stdlib hashtable [Index]