diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-10 01:40:46 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-10 01:40:46 -0800 |
commit | 7be3f9c4b4453a6ae7d9ba0f17953b3777baa4b1 (patch) | |
tree | b501f3af3bc16befeefb6278fbbc51a69577210c /txr.1 | |
parent | 9791175d2bb5175aa54379000bf19caf9b34a188 (diff) | |
download | txr-7be3f9c4b4453a6ae7d9ba0f17953b3777baa4b1.tar.gz txr-7be3f9c4b4453a6ae7d9ba0f17953b3777baa4b1.tar.bz2 txr-7be3f9c4b4453a6ae7d9ba0f17953b3777baa4b1.zip |
* eval.c (rperm, perm_str): Just in case, return a mutable empty
string, rather than null_string, which is a literal.
(k_conses, comb_while_fun, comb_gen_fun_common,
comb_list_gen_fun, comb_list, comb_vec_gen_fun, comb_vec,
comb_str_gen_fun, comb_str, comb): New static functions.
(eval_init): Registered comb as instrinsic.
* txr.1: Documented comb.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -7936,6 +7936,32 @@ permutations is of zero length. The permutations are lexicographically ordered. +.SS Function comb + +.TP +Syntax: + + (comb <seq> <len>) + +.TP +Description: + +The comb function returns a lazy list which consists of all +length <len> non-repeating combinations formed by taking items taken from +<seq>. "Non-repeating combinations" means that the combinations do not use any +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. + +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. + +The combinations are lexicographically ordered. + .SH CHARACTERS AND STRINGS .SS Function mkstring |