| hashtable-clear!(3scm) | Scheme Programmer's Manual | hashtable-clear!(3scm) |
NAME
hashtable-clear! - remove all entries from a hashtables
LIBRARY
(import (rnrs)) ;R6RS (import (rnrs hashtables)) ;R6RS
SYNOPSIS
(hashtable-clear! hashtable) (hashtable-clear! hashtable k)
DESCRIPTION
Removes all associations from hashtable.
If a second argument is given, the current capacity of the hashtable is reset to approximately k elements.
RETURN VALUES
This procedure returns unspecified values.
EXAMPLES
(let ((ht (make-eq-hashtable)))
(hashtable-set! ht 'foo 'bar)
(hashtable-clear! ht)
(hashtable-size ht))
=> 0
ERRORS
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.
SEE ALSO
hashtable-delete!(3scm)
STANDARDS
R6RS
HISTORY
This procedure first appeared in R6RS.
AUTHORS
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.
| 2023-01-21 |