aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-07-08 13:04:01 -0500
committerColin Okay <cbeok@protonmail.com>2020-07-08 13:04:01 -0500
commit7e9d644f2133639b5deb9dfdb6196d78517a2d8a (patch)
tree6549ce61fe953614f9fc57f11316d76e248a4a55
parent7d8b6f29dc951b0d9c2962c82e8068816cd4c34a (diff)
bugfix in range
-rw-r--r--gtwiwtg.lisp4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtwiwtg.lisp b/gtwiwtg.lisp
index f52e7b9..202063a 100644
--- a/gtwiwtg.lisp
+++ b/gtwiwtg.lisp
@@ -50,7 +50,9 @@ If TO is NIL, then the generator produces an infinite sequence."
(make-instance 'generator!
:state (list (- from by) to)
:next-p-fn (lambda (state) (or (not to)
- (apply comparator state)))
+ (funcall comparator
+ (+ by (first state))
+ (second state))))
:next-fn (lambda (state)
(incf (car state) by)
(values (car state) state)))))