Hi group,

say I have 2 sequences

(def seq-a '("a1" "a2" "a3"))
(def seq-b '("b1" "b2" "b3"))

and want to iterate over them in parallel, like this

(par-doseq [a seq-a b seq-b] (prn a b))

which should print

"a1" "b1"
"a2" "b2"
"a3" "b3"

The way I do it currently is using "map" (and "last" to fight
lazyness):

(last (map (fn [a b] (prn a b)) seq-a seq-b))

This works, but I'm not sure if that's the best way to do it.

Btw, I use this inside of JComponent.paintComponent(Graphics), in
other words for side-effects.

Thanks
Rowdy
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to