summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-12-29 00:26:21 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-12-29 00:26:21 -0800
commit4b772db7b36abc597d17d2c994227b5c032323ae (patch)
treeb5a9dd0346c859a3fe675fea31a4db28599d9bf2 /txr.1
parent9dae5ba49c7595355ddcf336032c2e12aa84be5f (diff)
downloadtxr-4b772db7b36abc597d17d2c994227b5c032323ae.tar.gz
txr-4b772db7b36abc597d17d2c994227b5c032323ae.tar.bz2
txr-4b772db7b36abc597d17d2c994227b5c032323ae.zip
shuffle/nshuffle: take optional random state argument.
* eval.c (eval_init): Register shuffle and nshuffle as two-argument functions with optional argument. * lib.c (nshuffle): Take random-state argument, defaulting to value of random_state special variable. (shuffle): Take random-state argument, pass down to nshuffle. * lib.h (shuffle, nshuffle): Declarations updated. * txr.1: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.18
1 files changed, 5 insertions, 3 deletions
diff --git a/txr.1 b/txr.1
index e287c8bb..1829471c 100644
--- a/txr.1
+++ b/txr.1
@@ -33727,8 +33727,8 @@ in the APL language.
.coNP Functions @ shuffle and @ nshuffle
.synb
-.mets (shuffle << sequence )
-.mets (nshuffle << sequence )
+.mets (shuffle < sequence <> [ random-state ])
+.mets (nshuffle < sequence <> [ random-state ])
.syne
.desc
The
@@ -33745,7 +33745,9 @@ itself.
The rearrangement depends on pseudo-random numbers obtained from the
.code rand
-function.
+function. The
+.meta random-state
+argument, if present, is passed to that function.
The
.code nshuffle