Skip to content

Commit d340de4

Browse files
author
angusiguess
committed
Handle the empty case, fix eduction to conform to seqable
1 parent b3d4116 commit d340de4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pixie/stdlib.pxi

+2-2
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,7 @@ not enough elements were present."
19071907

19081908
ISeqable
19091909
(-seq [self]
1910-
(reduce conj self)))
1910+
(seq (reduce conj self))))
19111911

19121912
(defn eduction
19131913
"Returns a reducible/iterable application of the transducers
@@ -2192,7 +2192,7 @@ For more information, see http://clojure.org/special_forms#binding-forms"}
21922192
"Returns a lazy sequence of `data`, optionally transforming it using `xform`.
21932193
Given an `eduction`, produces a lazy sequence of it."
21942194
([eduction]
2195-
(lazy-seq (cons (first eduction) (sequence (rest eduction)))))
2195+
(when (seq eduction) (lazy-seq (cons (first eduction) (sequence (rest eduction))))))
21962196
([xform data]
21972197
(sequence (eduction xform data))))
21982198

0 commit comments

Comments
 (0)