-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I experimented with adding iterators (as cl-transducers already defined enumerator
) on top of transducers, and it works fine. Is this something you would consider adding to the library or accepting a PR for?
(defparameter i
(make-generator-iterator
(comp (map #'1+)
(filter #'evenp))
nil
(ints 0)))
;; first match on second iteration
(next i)
; => 1, NIL
;; next match on fourth iteration
(next i)
; => 3, NIL
(defparameter s
(make-generator-iterator
(comp (map #'1+)
(filter #'evenp)
(take 3))
#'+
(ints 0)))
(next s)
; => 1, NIL
(next s)
; => 3, NIL
;; returns sum when done
(next s)
; => 12, DONE
Metadata
Metadata
Assignees
Labels
No labels