summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-10 01:40:46 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-10 01:40:46 -0800
commit7be3f9c4b4453a6ae7d9ba0f17953b3777baa4b1 (patch)
treeb501f3af3bc16befeefb6278fbbc51a69577210c /txr.1
parent9791175d2bb5175aa54379000bf19caf9b34a188 (diff)
downloadtxr-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.126
1 files changed, 26 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 4be1ae19..900a860e 100644
--- a/txr.1
+++ b/txr.1
@@ -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