We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d24b17a + 3f81e65 commit 36ce07eCopy full SHA for 36ce07e
1 file changed
pixie/stdlib.pxi
@@ -3080,11 +3080,11 @@ ex: (vary-meta x assoc :foo 42)"
3080
(deftype Iterate [f x]
3081
IReduce
3082
(-reduce [self rf init]
3083
- (loop [col (rest self)
3084
- acc (rf init (first self))]
+ (loop [next (f x)
+ acc (rf init x)]
3085
(if (reduced? acc)
3086
@acc
3087
- (recur (rest col) (rf acc (first col))))))
+ (recur (f next) (rf acc next)))))
3088
ISeq
3089
(-seq [self]
3090
(cons x (lazy-seq* (fn [] (->Iterate f (f x)))))))
0 commit comments