Version: 5.1.3
16 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).
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((1 . (one uno)) (2 . (two dos))) | | > h | '#hash((1 . (one uno ein une)) (2 . (two dos zwei deux))) |
|