Created
April 16, 2015 18:05
-
-
Save postspectacular/c95cff19bc82ba919813 to your computer and use it in GitHub Desktop.
Clojurescript eduction reduce bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; CLJS 0.0-3196 | |
(reduce conj [] (eduction (filter identity) [1 2 3 4])) | |
;; [1 2 3 4] | |
(defrecord Foo [state]) | |
(defn add-foo [foo x] (Foo. (conj (:state foo) x))) | |
(reduce add-foo (Foo. []) (sequence (filter identity) [1 2 3 4])) | |
;; => #cljs.user.Foo{:state [1 2 3 4]} | |
(reduce add-foo (Foo. []) (eduction (filter identity) [1 2 3 4])) | |
;; extra nil added :( - why? | |
;; => #cljs.user.Foo{:state [1 2 3 4 nil]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment