Uploaded image for project: 'ClojureScript'
  1. CLJS-1209

Reduce produces additional final nil when used w/ eduction

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: 0.0-3269
    • Fix versions: 0.0-3308
    • Labels:

      Description

      Unable to find source-code formatter for language: clojure. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      (defn my-conj
        [acc x]
        (prn acc x)
        (conj acc x))
      
      (reduce my-conj [] (eduction (map identity) [1 2 3]))
      ;; [] 1
      ;; [1] 2
      ;; [1 2] 3
      ;; [1 2 3] nil
      ;; [1 2 3 nil]
      

      This seems to be a CLJS specific issue - the above works fine in CLJ1.7.0-beta1. On the other hand, reductions too doesn't suffer this behavior (in CLJS):

      Unable to find source-code formatter for language: clojure. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      (reductions my-conj [] (eduction (map identity) [1 2 3]))
      ;; [] 1
      ;; [1] 2
      ;; [1 2] 3
      ;; ([] [1] [1 2] [1 2 3])
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              toxi Karsten Schmidt
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: