I.e., something like:
(defn dowith [f & arglists]
(doseq [args arglists] (apply f args)))
Is there a built-in function like that in Clojure?
I.e., something like:
(defn dowith [f & arglists]
(doseq [args arglists] (apply f args)))
Is there a built-in function like that in Clojure?
I write things like that moderately often; its just so short that it's not really worth wrapping:
(map #(apply myfun %) list-of-arglists)
I use map
most often so i get the results and keep it lazy. of course if you don't want it lazy and don't want the results then doseq
is fine also.
No, there is no built-in function that does that.