In Clojure, what is the best way for iterating concurrently on two seqs and calling a function on the two running elements?
For example:
(def a (range 3))
(def b (range 100 103))
(defn my-func [] ...) ;some custom code
The code should execute my-func 3 times, like this:
(my-func 0 100)
(my-func 1 101)
(my-func 2 102)
How can I achieve that without defining any function or macro?
mapis exactly what you need, it takes a function and any number of seqs and calls them just as you wish.and because
mapis lazy if you want the function to actually run now: