Skip to main content
clarified relation to question
Source Link
Mars
  • 8.9k
  • 2
  • 47
  • 73

I don't think there's an existing function, but you could useusing pcalls rather than pmap seems a little closer to what you want:

(defn prun [n f] (apply pcalls (repeat n f))) 

You don't need to wrap myfunc with #() in the call torepeatedly, btw, nor calling prun as defined above:

(prun 10 myfunc) 

You may find pvalues useful as well.

I don't think there's an existing function, but you could use pcalls:

(defn prun [n f] (apply pcalls (repeat n f))) 

You don't need to wrap myfunc with #() in the call torepeatedly, btw, nor calling prun as defined above:

(prun 10 myfunc) 

You may find pvalues useful as well.

I don't think there's an existing function, but using pcalls rather than pmap seems a little closer to what you want:

(defn prun [n f] (apply pcalls (repeat n f))) 

You don't need to wrap myfunc with #() in the call torepeatedly, btw, nor calling prun as defined above:

(prun 10 myfunc) 

You may find pvalues useful as well.

Source Link
Mars
  • 8.9k
  • 2
  • 47
  • 73

I don't think there's an existing function, but you could use pcalls:

(defn prun [n f] (apply pcalls (repeat n f))) 

You don't need to wrap myfunc with #() in the call torepeatedly, btw, nor calling prun as defined above:

(prun 10 myfunc) 

You may find pvalues useful as well.