diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-05-13 18:03:39 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-05-13 18:03:39 -0700 |
commit | 0786f1422cf0a949fb0e0daf98852123ced19c9a (patch) | |
tree | 5f0c481309f34702a5c97f77d01fcda940c911df /txr.1 | |
parent | 74c257cc189dff497bf92d6652a95031011aa8f2 (diff) | |
download | txr-0786f1422cf0a949fb0e0daf98852123ced19c9a.tar.gz txr-0786f1422cf0a949fb0e0daf98852123ced19c9a.tar.bz2 txr-0786f1422cf0a949fb0e0daf98852123ced19c9a.zip |
lib: use seq-info for sort and shuffle.
* lib.c (sort, shuffle): Switch to seq_info. For consistency
with sort, shuffle now handles hashes in the same peculiar
way.
* txr.1: Document hash behavior for sort and shuffle.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -32602,6 +32602,19 @@ For strings and vectors, .code sort is not stable. +The +.code sort +function can be applied to hashes. It produces meaningful behavior +for a hash table which contains +.I N +keys which are the integers from 0 to +.IR "N - 1" . +Such as hash is treated as if it were a vector. The values are sorted +and re-assigned to sorted order to the integer keys. +The behavior of +.code sort +is not specified for hashes whose contents do not conform to this convention. + .coNP Function @ grade .synb .mets (grade < sequence >> [ lessfun <> [ keyfun ]]) @@ -32668,6 +32681,13 @@ The rearrangement depends on pseudo-random numbers obtained from the .code rand function. +The +.code shuffle +function supports hash tables in a manner analogous to the way +.code sort +supports hash tables; the same remarks apply as in the description +of that function. + .coNP Function @ sort-group .synb .mets (sort-group < sequence >> [ keyfun <> [ lessfun ]]) |