Trans <transfire / gmail.com> wrote: > Hi Ryan, > > I didn't modify a core class. EnumerableArgs is a complete rewrite of > Enumerable and stands on it own. > > The Enumerator approach lacks for a few reasons. > > 1. Its' longer and less readable. Can't see this. > 2. It's creates an intermedeary object. As all the "every" approaches that promote method chaining. Those might even create multiple proxy objects depending on the implementation. > 4. It means Enumerable remains less useful. I cannot see this. > While Enumerator may have it's uses, I do not find it's use here > "Ruby-esque", for much the same reason David disliked #every --I have > to agree. The big advantage of Enumerator is that it implements Enumerable thus allowing all code created for Enumerables to work with an Enumerator instance. The big disadvantage of your approach OTOH is that you modify an Enumerable instance and thus shadowing methods defined in Enumerable. This may lead to unexpected effects if people rely on the original Enumerable methods. Also, how many classes do you know that have method #each that accepts arguments? I'd go even further than Ryan, I think Enumerator is better in this case than your approach. Cheers robert