diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-24 06:37:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-24 06:37:19 -0700 |
commit | 4e3e4e1ccc60331ff8ff4c1c139e9da3c95e2272 (patch) | |
tree | 05869854697db857750edeb23b091c39983a4e1e /txr.1 | |
parent | 87af2fde6249070addbed571482ddae251d90161 (diff) | |
download | txr-4e3e4e1ccc60331ff8ff4c1c139e9da3c95e2272.tar.gz txr-4e3e4e1ccc60331ff8ff4c1c139e9da3c95e2272.tar.bz2 txr-4e3e4e1ccc60331ff8ff4c1c139e9da3c95e2272.zip |
New function: shuffle.
* eval.c (eval_init): Register shuffle as intrinsic.
* lib.c (shuffle): New function.
* lib.h (shuffle): Declared.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -19544,6 +19544,27 @@ For strings and vectors, .code sort is not stable. +.coNP Function @ shuffle +.synb +.mets (shuffle << sequence ) +.syne +.desc +The +.code shuffle +function pseudo-randomly rearranges the elements of +.metn sequence . +This is performed in place: +.meta sequence +object is modified. + +The return value is +.meta sequence +itself. + +The rearrangement depends on pseudo-random numbers obtained from the +.code rand +function. + .coNP Function @ sort-group .synb .mets (sort-group < sequence >> [ keyfun <> [ lessfun ]]) |