Cat is just missing a print-method entry. Try (into [] (r/fold 1 r/cat r/append! [1 2 3])), the result is what you'd expect. The n parameter isn't actually about parallelism but partition size. Fork/Join will decide the parallelism. In the case of n=1 the input will be split into 3 partition of 1 (eg, [[1] [2] [3]]) and then handed off to reducers, the default of n=512 is larger than your input so you'll just use regular reduce.
/thomas On Monday, February 9, 2015 at 10:38:59 AM UTC+1, Aaron Cohen wrote: > > I'm not sure if the 4-arity fold function is working as expected. My > understanding is that it should be equivalent to the 3-arity version, but > with specified parallelism. > > However: > > (r/fold r/cat r/append! [1 2 3]) => [1 2 3] > > (r/fold 1 r/cat r/append! [1 2 3]) => #<Cat > clojure.core.reducers.Cat@4b2ae664> > > I don't actually understand how this is possible from reading the source > code. > > --Aaron > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.