From 387d9c08e44db206e995bbbf272b7b8ea8580ad7 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 11 Apr 2015 18:55:27 -0700 Subject: * txr.1: Add powerset example under comb function --- txr.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ) -- cgit v1.2.3