Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Completed
    • Affects versions: Release 1.7
    • Fix versions: Release 1.7
    • Labels:
    • Approval:
      Vetted
    • Patch:
      Code

      Description

      Re-reduced from composed transformation functions:

      • re-wraps the Reduced when it should not (take)
      • forget to unwrap the Reduced (partition-by, partition-all)
      ; nested reduced
      => (transduce (comp (take 1)) conj [:a])
      [:a]
      => (transduce (comp (take 1) (take 1)) conj [:a])
      #<Reduced@65979031: [:a]>
      => (transduce (comp (take 1) (take 1) (take 1)) conj [:a])
      #<Reduced@fcbc8d1: #<Reduced@60bea99a: [:a]>>
      => (transduce (comp (take 1) (take 1) (take 1) (take 1)) conj [:a])
      #<Reduced@6e9915bb: #<Reduced@5c712302: #<Reduced@472b9f70: [:a]>>>
       
      ; problems not appearing in all contexts
      ; not ok with transduce
      => (transduce (comp (partition-by keyword?) (take 1)) conj [] [:a])
      #<Reduced@5156c42e: [[:a]]>
      ; but ok with sequence
      => (sequence (comp (partition-by keyword?) (take 1)) [:a])
      ([:a])
      ; well, not always
      => (sequence (comp (partition-by keyword?) (take 1)  (partition-by keyword?) (take 1)) [:a])
      ClassCastException clojure.lang.Reduced cannot be cast to clojure.lang.LazyTransformer  clojure.lang.LazyTransformer$Stepper$1.invoke (LazyTransformer.java:104)
      

      See also: https://groups.google.com/d/msg/clojure-dev/cWzMS_qqgcM/7IAhzMKzVigJ

        Attachments

          Activity

            People

            • Assignee:
              richhickey Rich Hickey
              Reporter:
              cgrand Christophe Grand
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: