hashtable-entries - get the entries in the hashtable as two vectors
(import (rnrs)) ;R6RS
(import (rnrs hashtables)) ;R6RS
Returns a vector of the keys in
and a vector of the corresponding values.
Returns two values; two vectors of equal length.
(let ((h (make-eqv-hashtable)))
(hashtable-set! h 1 'one)
(hashtable-set! h 2 'two)
(hashtable-set! h 3 'three)
=> #(1 2 3)
#(one two three)
; entries may be in different order
This procedure is used when iterating over the entries of a hashtable
in an indeterminate order or when you need all the associated values
from a hashtable.
If a program needs all entries in a hashtable then this procedure is
significantly faster than using
for each key, because it does not need to use the hash and equal
This procedure is unique to R6RS. An equivalent procedure can be
found in SRFI-125 under the name
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
This procedure first appeared in R6RS.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Markup created by unroff 1.0sc, March 04, 2023.