hashtable-clear! - remove all entries from a hashtables
(import (rnrs)) ;R6RS
(import (rnrs hashtables)) ;R6RS
(hashtable-clear! hashtable)
(hashtable-clear! hashtable k)
Removes all associations from hashtable.
If a second argument is given, the current capacity of the
hashtable is reset to approximately k elements.
This procedure returns unspecified values.
(let ((ht (make-eq-hashtable)))
(hashtable-set! ht 'foo 'bar)
(hashtable-clear! ht)
(hashtable-size ht))
=> 0
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. In particular, hashtable should be a mutable hashtable and
k should be an exact non-negative integer.
This procedure first appeared in R6RS.