Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Clojure

Idiom #242 Iterate over a set

Call a function f on each element e of a set x.

(doseq [e x]
  (f e))
#include <algorithm>
std::for_each(x.begin(), x.end(), f);

New implementation...