hashtable-set! - change an association in a hashtable
LIBRARY
(import (rnrs)) ;R6RS
(import (rnrs hashtables)) ;R6RS
SYNOPSIS
(hashtable-set! hashtable key obj)
DESCRIPTION
Changes
hashtable
to associate key with
obj,
adding a new
association or replacing any existing association for
key.
IMPLEMENTATION NOTES
This procedure can trigger growth of the hashtable, which can require
all keys to be hashed again.
RETURN VALUES
Returns unspecified values.
EXAMPLES
(define ht (make-eq-hashtable))
(hashtable-set! ht 'foo 'bar)
(hashtable-ref ht 'foo #f) => bar
COMPATIBILITY
This procedure is unique to R6RS. Similar procedures exist in
SRFI-69 and SRFI-125.
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 hashtable and
key
should be in the domain of the hashtable's hash and equal functions.
SEE ALSO
make-hashtable(3scm),
hashtable-ref(3scm)
STANDARDS
R6RS
HISTORY
This procedure first appeared in R6RS. An equivalent procedure already
existed in SRFI-69 under the name
hash-table-set!.
AUTHORS
This page is part of the
scheme-manpages
project.
It includes materials from the RnRS documents.
More information can be found at
https://github.com/schemedoc/manpages/
.
Markup created by unroff 1.0sc, March 04, 2023.