7 Utilities for Hash Tables
(require lathe-comforts/hash) | package: lathe-comforts-lib |
procedure
(make-similar-hash example assocs) → hash?
example : hash? assocs : (listof pair?)
procedure
(hash-comparison-same? a b) → boolean?
a : hash? b : hash?
procedure
(hash-keys-same? a b) → boolean?
a : hash? b : hash?
If the thread performing this operation is terminated and the given hash tables use eqv? or equal? as their comparison procedure, all current and future operations on those hash tables may block indefinitely.
If either of the given hash tables is modified partway through this operation, or if either one is an equal?-based hash table whose keys have been mutated after insertion, the resulting behavior may be unpredictable.
procedure
(hash-ref-maybe hash key) → maybe?
hash : hash? key : any/c
If the thread performing this operation is terminated and the given hash table uses eqv? or equal? as its comparison procedure, all current and future operations on that hash table may block indefinitely.
If the given hash table is modified partway through this operation, or if it’s an equal?-based hash table whose keys have been mutated after insertion, the resulting behavior may be unpredictable.
procedure
(hash-set-maybe hash key maybe-value) → hash?
hash : hash? key : any/c maybe-value : maybe?
If the given hash table is an equal?-based hash table whose keys have been mutated after insertion, the resulting behavior may be unpredictable.
If the result is an equal?-based hash table and one of its keys is mutated after insertion, it may have unpredictable behavior with other hash-table-related utilities.
procedure
(hash-kv-map-sorted key<? hash func) → list?
key<? : (-> any/c any/c boolean?) hash : hash? func : (-> any/c any/c any/c)
The number of times key<? is called is unspecified. The particular argument values it receives are unspecified, aside from the fact that they are all keys of hash.
If the given hash table is modified while this operation is setting up (before it calls either of the given functions for the first time), the particular list of entries it processes may be unpredictable. Modifications after that will not affect the operation.
If multiple results of func have the same key, the last one to be computed takes precedence.
The resulting hash table has the same key-comparison procedure, key-holding strength, and mutability as hash. Each result of func may have its own combination of key-comparison procedure, key-holding strength, and mutability; these properties will be ignored.
If hash is modified while this operation is setting up (before it calls the given function for the first time), the particular list of entries this operation processes may be unpredictable. Modifications after that will not affect the operation.
Likewise, if a result of func is modified between the time it is returned and the time this operation either returns or calls func again, then the particular list of entries this operation collects from that func result may be unpredictable.
If the overall result is an equal?-based hash table and one of its keys is mutated after insertion, it may have unpredictable behavior with other hash-table-related utilities.
The resulting hash table has the same key-comparison procedure, key-holding strength, and mutability as the given one.
If the given hash table is modified while this operation is setting up (before it calls the given function for the first time), the particular list of entries it processes may be unpredictable. Modifications after that will not affect the operation.
If the result is an equal?-based hash table and one of its keys is mutated after insertion, it may have unpredictable behavior with other hash-table-related utilities.
The resulting hash table has the same key-comparison procedure, key-holding strength, and mutability as the given one.
If the given hash table is modified while this operation is setting up (before it calls the given function for the first time), the particular list of entries it processes may be unpredictable. Modifications after that will not affect the operation.
If the result is an equal?-based hash table and one of its keys is mutated after insertion, it may have unpredictable behavior with other hash-table-related utilities.
If the given hash table is modified partway through this operation, the resulting behavior may be unpredictable.
If the given hash table is modified partway through this operation, the resulting behavior may be unpredictable.
If the given hash table is modified partway through this operation, the resulting behavior may be unpredictable.
The resulting hash table has the same key-comparison procedure, key-holding strength, and mutability as the given one.
If the given hash table is modified while this operation is setting up (before it calls the given function for the first time), the particular list of entries it processes may be unpredictable. Modifications after that will not affect the operation.
If the result is an equal?-based hash table and one of its keys is mutated after insertion, it may have unpredictable behavior with other hash-table-related utilities.
The resulting hash table has the same key-comparison procedure, key-holding strength, and mutability as the given one.
If the given hash table is modified while this operation is setting up (before it calls the given function for the first time), the particular list of entries it processes may be unpredictable. Modifications after that will not affect the operation.
If the given hash table is modified partway through this operation, the resulting behavior may be unpredictable.
If the given hash table is modified partway through this operation, the resulting behavior may be unpredictable.
If the given hash table is modified partway through this operation, the resulting behavior may be unpredictable.