git.fiddlerwoaroof.com
Browse code

feat(transducers): add lazy-sequence constructor

fiddlerwoaroof authored on 19/12/2020 06:32:19
Showing 1 changed files
... ...
@@ -101,6 +101,8 @@
101 101
 
102 102
 (defclass lazy-sequence ()
103 103
   ((%next :initarg :next :reader next)))
104
+(defun lazy-sequence (next)
105
+  (make-instance 'lazy-sequence :next next))
104 106
 (defmethod reduce-generic ((seq lazy-sequence) (func function) init)
105 107
   (let ((next (next seq)))
106 108
     (loop for next-val = (funcall next)