summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-05-13 18:03:39 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-05-13 18:03:39 -0700
commit0786f1422cf0a949fb0e0daf98852123ced19c9a (patch)
tree5f0c481309f34702a5c97f77d01fcda940c911df /txr.1
parent74c257cc189dff497bf92d6652a95031011aa8f2 (diff)
downloadtxr-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.120
1 files changed, 20 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 4b6e998c..e83cdfb6 100644
--- a/txr.1
+++ b/txr.1
@@ -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 ]])