summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-04-11 18:55:27 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-04-11 18:55:27 -0700
commit387d9c08e44db206e995bbbf272b7b8ea8580ad7 (patch)
tree6e73c3f7b19f89d1c5272a4ef7736a92c925fc3c
parent38d32cd5006286ad87cf92b65df2633ee7f2db6b (diff)
downloadtxr-387d9c08e44db206e995bbbf272b7b8ea8580ad7.tar.gz
txr-387d9c08e44db206e995bbbf272b7b8ea8580ad7.tar.bz2
txr-387d9c08e44db206e995bbbf272b7b8ea8580ad7.zip
* txr.1: Add powerset example under comb function
-rw-r--r--txr.110
1 files changed, 10 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index c193efd2..b23961d7 100644
--- a/txr.1
+++ b/txr.1
@@ -15916,6 +15916,16 @@ This requirement is not applicable when
.meta seq
is a hash table.
+.TP* Example:
+.cblk
+ ;; powerset function, in terms of comb.
+ ;; Yields a lazy list of all subsets of s,
+ ;; expressed as sequences of the same type as s.
+
+ (defun powerset (s)
+ (mappend* (op comb s) (range 0 (length s))))
+.cble
+
.coNP Function @ rcomb
.synb
.mets (rcomb < seq << len )