6.1.1
11 Hash Tables
This module provides tools for manipulating hash tables.
Computes the union of h0 with each hash table h by functional
update, adding each element of each h to h0 in turn. For each
key k and value v, if a mapping from k to some value
v0 already exists, it is replaced with a mapping from k to
(combine/key k v0 v).
Examples: |
| '#hash((1 . one) (2 . two) (3 . three)) | | '#hash((1 . (one uno ein une)) (2 . (two dos zwei deux))) |
|
Computes the union of h0 with each hash table h by mutable
update, adding each element of each h to h0 in turn. For each
key k and value v, if a mapping from k to some value
v0 already exists, it is replaced with a mapping from k to
(combine/key k v0 v).
Examples: |
| | > h | '#hash() | > (hash-union! h (make-immutable-hash '([1 one uno] [2 two dos]))) | | > h | '#hash((2 . (two dos)) (1 . (one uno))) | | | > h | '#hash((2 . (two dos zwei deux)) (1 . (one uno ein une))) |
|