hashtable-copy - copy a hashtable
(import (rnrs)) ;R6RS
(import (rnrs hashtables)) ;R6RS
(hashtable-copy hashtable mutable)
Returns a copy of
argument is provided and is true, the returned hashtable is mutable;
otherwise it is immutable.
Returns a single value; a hashtable.
(define (alist->eqv-hashtable alist)
(let ((ht (make-eqv-hashtable)))
(do ((alist alist (cdr alist)))
(hashtable-set! ht (caar alist) (cdar alist)))))
(alist->eqv-hashtable '((0 . zero) (1 . one) (2 . three))))
=> #(0 1 2)
#(zero one three)
Allowing the hashtable to be immutable allows implementations to
create an optimized representation for the hashtable.
This procedure is unique to R6RS.
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.
must be a hashtable.
This procedure first appeared in R6RS, but a similar procedure was
also present in SRFI-69.
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.