diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-10 04:46:57 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-10 04:46:57 -0800 |
commit | 13fa06edcfa454ec0f0bb5ae6fb51c968f5dcdfd (patch) | |
tree | b6274e7aee476556a02048fecbc0b66b329ca675 /txr.1 | |
parent | 7be3f9c4b4453a6ae7d9ba0f17953b3777baa4b1 (diff) | |
download | txr-13fa06edcfa454ec0f0bb5ae6fb51c968f5dcdfd.tar.gz txr-13fa06edcfa454ec0f0bb5ae6fb51c968f5dcdfd.tar.bz2 txr-13fa06edcfa454ec0f0bb5ae6fb51c968f5dcdfd.zip |
* eval.c (rcomb_while_fun, rcomb_gen_fun_common,
rcomb_list_gen_fun, rcomb_list, rcomb_vec_gen_fun, rcomb_vec,
rcomb_str_gen_fun, rcomb_str, rcomb): New static functions.
(eval_init): Register rcomb as intrinsic.
* txr.1: Documented rcomb.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 32 |
1 files changed, 29 insertions, 3 deletions
@@ -7936,7 +7936,7 @@ permutations is of zero length. The permutations are lexicographically ordered. -.SS Function comb +.SS Functions comb and rcomb .TP Syntax: @@ -7952,8 +7952,8 @@ length <len> non-repeating combinations formed by taking items taken from element of <seq> more than once. If <seq> contains no duplicates, then the combinations contain no duplicates. -Argument <len> must be a positive integer no greater than the length of <seq>, -and <seq> must be a sequence. +Argument <len> must be a nonnegative integer no greater than the length of +<seq>, and <seq> must be a sequence. The combinations in the returned list are sequences of the same kind as <seq>. @@ -7962,6 +7962,32 @@ permutations is of zero length. The combinations are lexicographically ordered. +.SS Function rcomb + +.TP +Syntax: + + (rcomb <seq> <len>) + +.TP +Description: + +The comb function returns a lazy list which consists of all +length <len> repeating combinations formed by taking items taken from +<seq>. "Repeating combinations" means that the combinations can use +an element of <seq> more than once. + +Argument <len> must be a nonnegative integer, and <seq> must be a sequence. + +The combinations in the returned list are sequences of the same kind as <seq>. + +If <len> is zero, then a list containing one combination is returned, and that +permutations is of zero length. This is true even if <seq> is empty. + +If <seq> is empty, and <len> is nonzero, then an empty list is returned. + +The combinations are lexicographically ordered. + .SH CHARACTERS AND STRINGS .SS Function mkstring |