aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README.md19
1 files changed, 18 insertions, 1 deletions
diff --git a/README.md b/README.md
index 3a6c383..a18d5b9 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,24 @@ example apears at the end of the document, following the tutorial.
(1 2 4) (1 2 3) (1 2 3 4))
-````
+```
+
+Note: The above is just for demonstration purposes and is much slower
+than a version you'd write without generators. Something like:
+
+``` lisp
+
+(defun powerset (xs)
+ (if (null xs) (list nil)
+ (let ((subsets (powerset (cdr xs))))
+ (append subsets
+ (mapcar (lambda (subset) (cons (car xs) subset))
+ subsets)))))
+```
+
+The "vanilla CL" version is MUCH faster, but may not be possible if
+you're generating powersets of very long lists. The trade off, as
+usual, is between speed and memory.
### A Kind Of Grep