diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | gtwiwtg.lisp | 10 |
2 files changed, 8 insertions, 4 deletions
@@ -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 |