We're updating the issue view to help you get more done. 

reducers/mapcat ignores Reduced

Description

Problem: clojure.core.reducers/mapcat does not stop on reduced? values.

Demonstration:

1 2 3 4 5 6 7 8 9 (require '[clojure.core.reducers :as r]) (->> (concat (range 100) (lazy-seq (throw (Exception. "Too eager")))) (r/mapcat (juxt inc str)) (r/take 5) (into [])) ;; Exception Too eager ;; Expected return value: [1 "0" 2 "1" 3]

Cause: r/mapcat introduces an intermediate reduce which swallows the reduced value coming from r/take.

Patch: lazy-rmapcat2.diff

Environment

None

Status

Assignee

Christophe Grand

Reporter

Christophe Grand

Labels

None

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Release 1.5

Priority

Major