fix Issue 12409 - Add "each" function as found in Ruby and jQuery

https://d.puremagic.com/issues/show_bug.cgi?id=12409
I wasn't thinking of C++ iterators when I chose the term, but more of those found in Python/Ruby/C#. What term would you suggest, then? (If not for the parameter name, then for the inferred type name).