+1 ! I use 'fold-into-vec' regularly.... :)

Jim

On 26/04/13 18:07, Alan Busby wrote:
Some additional pointers here (this is a little old though);
http://www.thebusby.com/2012/07/tips-tricks-with-clojure-reducers.html


On Fri, Apr 26, 2013 at 11:51 PM, László Török <ltoro...@gmail.com <mailto:ltoro...@gmail.com>> wrote:

    Hi,

    Not sure what you are trying to do, but xxx is a lazy seq, thus it
    can only be consumed sequentially and fold falls back to reduce

    You need a vector.

    Las

    Sent from my phone

    On Apr 26, 2013 4:46 PM, "Stanislav Yurin" <jusk...@gmail.com
    <mailto:jusk...@gmail.com>> wrote:

        I was assuming that following code will fold in parallel, but
        it is reduced sequentially

        (require '[clojure.core.reducers :as r])
        (defn test1
        [x]
        (Thread/sleep 1000)
        (println (str "Finished:" x))
        x)
        (def xxx (r/map test1 (range 100)))
        (r/fold + xxx)

        What am I doing wrong?
        Thanks.
-- -- 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
        <mailto: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
        <mailto:clojure%2bunsubscr...@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
        <mailto:clojure%2bunsubscr...@googlegroups.com>.
        For more options, visit https://groups.google.com/groups/opt_out.


-- -- 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
    <mailto: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
    <mailto:clojure%2bunsubscr...@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
    <mailto:clojure%2bunsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/groups/opt_out.



--
--
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/groups/opt_out.



--
--
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/groups/opt_out.


Reply via email to