Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: Release 1.5
    • Fix versions: Release 1.6
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      Description

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

      Demonstration:

      (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

        Attachments

          Activity

            People

            • Assignee:
              cgrand Christophe Grand
              Reporter:
              cgrand Christophe Grand
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: