summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
Diffstat (limited to 'txr.1')
-rw-r--r--txr.133
1 files changed, 33 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 512f2b82..78df5c9e 100644
--- a/txr.1
+++ b/txr.1
@@ -19455,6 +19455,36 @@ function instead.
19455In addition to storing key-value pairs, a hash table can have a piece of 19455In addition to storing key-value pairs, a hash table can have a piece of
19456information associated with it, called the user data. 19456information associated with it, called the user data.
19457 19457
19458A hash table can be traversed to visit all of the keys and data. The order of
19459traversal bears no relation to the order of insertion, or to any properties of
19460the key type.
19461
19462During an open traversal, new keys can be inserted into a hash table or deleted
19463from it while a a traversal is in progress. Insertion of a new key during
19464traversal will not cause any existing key to be visited twice or to be skipped;
19465however, it is not specified whether the new key will be traversed. Similarly,
19466if a key is deleted during traversal, and that key has not yet been visited, it
19467is not specified whether it will be visited during the remainder of the
19468traversal.
19469
19470An open traversal of a hash table is performed by the
19471.code maphash
19472function and the
19473.code dohash
19474operator. The traversal is open because code supplied by the program
19475is evaluated for each entry.
19476
19477The functions
19478.codn hash-keys ,
19479.codn hash-values ,
19480.codn hash-pairs ,
19481and
19482.code hash-alist also perform an open traversal, because they return
19483lazy lists. The traversal isn't complete until the returned lazy list
19484is fully instantiated. In the meanwhile, the
19485\*(TX program can mutate the hash table from which the lazy list
19486is being generated.
19487
19458.coNP Function @ hash-construct 19488.coNP Function @ hash-construct
19459.synb 19489.synb
19460.mets (hash-construct < hash-args << key-val-pairs ) 19490.mets (hash-construct < hash-args << key-val-pairs )
@@ -19888,6 +19918,9 @@ then the corresponding entries from
19888each list pairwise correspond to the pairs in 19918each list pairwise correspond to the pairs in
19889.metn hash . 19919.metn hash .
19890 19920
19921The list returned by each of these functions is lazy, and hence constitutes
19922an open traversal of the hash table.
19923
19891.coNP Operator @ dohash 19924.coNP Operator @ dohash
19892.synb 19925.synb
19893.mets (dohash ( < key-var < value-var < hash-form <> [ result-form ]) 19926.mets (dohash ( < key-var < value-var < hash-form <> [ result-form ])