5

I.e., something like:

(defn dowith [f & arglists]
  (doseq [args arglists] (apply f args)))

Is there a built-in function like that in Clojure?

4

2 に答える 2

5

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.

于 2012-05-02T19:39:55.180 に答える
3

No, there is no built-in function that does that.

于 2012-05-02T19:35:59.003 に答える