aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-07-13 15:14:00 -0500
committerColin Okay <cbeok@protonmail.com>2020-07-13 15:14:00 -0500
commit276477748a22975f9842d0683fcbf610c0e61c5d (patch)
treec65fdbedebadddc1ac799f59e934972d3053f2ff
parent7472336e62d4ae7f0a2775ae498b376d39aca895 (diff)
more documentation tweaks
-rw-r--r--README.md2
-rw-r--r--gtwiwtg.lisp10
2 files changed, 8 insertions, 4 deletions
diff --git a/README.md b/README.md
index c6544e5..376ac7c 100644
--- a/README.md
+++ b/README.md
@@ -249,7 +249,7 @@ Here are some simple examples of their use:
- `(zip! gen1 &rest gens)` is shorthand for `(map! #'list gen1 gen2 ...)`
- `(indexed! gen)` is shorthand for `(zip! (range) gen)`
-- `(concat! gen &rest gens)` is shorthand for `(inflate! #'identity (seq (list* gen1 gen2 ...)))`
+- `(concat! gen &rest gens)` concatenates generators
- `(skip! n gen)` produces a generator by skipping the first `n` values in `gen`
- `(skip-while! pred gen)` produces a generator by skippng elements of `gen` while `pred` is `t`
- `(merge! comp gen1 gen2 &rest gens)` emulates the behavior of `merge` but for generators
diff --git a/gtwiwtg.lisp b/gtwiwtg.lisp
index 1ce24af..14c0048 100644
--- a/gtwiwtg.lisp
+++ b/gtwiwtg.lisp
@@ -684,8 +684,12 @@ Examples:
(defun inject! (fn gen)
"Injects an effect into a generator. Use this to add a side-effect
-to the value generation process. The new generator produces exactly
-the same values as GEN.
+to the value generation process.
+
+Under most circumstances, the new generator produces exactly the same
+values as GEN. If, however, the values generated by GEN are being
+looked up in some remote memory location, and if FN is mutating that
+memory, then the new generator may produce different values.
Possibly good for debugging.
@@ -727,7 +731,7 @@ GN produces every Nth + (N-1) value of GEN, including the (N-1)th value.
This is sort of the opposite of INTERSPERSE!."
(loop
:for i :below n
- :for cloned :in (nfurcate! n gen)
+ :for cloned :in (nfurcate! n gen)
:collect
(let ((j i))
(map! #'second