aaa you want a scalar as the result? then use an outer reduce as well:
(reduce +
(pmap #(reduce + %) (partition-all 5 (range 1 20))))
=>190
Jim
On 02/02/13 13:10, Jim - FooBar(); wrote:
Use this:
(pmap #(reduce + %) (partition-all 5 (range 1 20)))
OR as you yourself said you can use 'apply' instead of reduce
Jim
On 02/02/13 12:31, Leandro Moreira wrote:
Hi there,
I have this:
*user=>* (partition-all 5 (range 1 20))
((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15) (16 17 18 19))
And I would like to apply the *pmap* over the partitions, something
like: (the line bellow doesn't work)
*user=>* (pmap + (partition-all 5 (range 1 20)))
/I would like to have this (pmap + (1 2 3 4 5) (6 7 8 9 10) (11 12 13
14 15) (16 17 18 19)) instead of this (pmap + ((1 2 3 4 5) (6 7 8 9
10) (11 12 13 14 15) (16 17 18 19)))/
How can I apply pmap over a partition-all result?
If it's possible, by doing that am I distributing the load better
than if I used the pmap with the whole list?
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
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.