From: Trans Date: 2008-09-11T09:48:49+09:00 Subject: Re: Redefe each to include each_with_index and arity=2 On Sep 10, 2:59 pm, "DanDiebolt.exe" wrote: > > ... each_with_index and each depend on each other > >   > Maybe someone with more knowlege can track this dependance down. I am keen to learn, but I have to admit that I am stretching my understanding of the Ruby language here. >   > I would like to ask others if they think having each overloaded to take either |item| or |item,index| would be a general language improvement. Also, for greatest generality should this proposed redefinition of each be made to the class Array or to the enumerator mixin or somewhere else? Can't do it, it would break things. I've always though an special 'it' object would be nice though. Eg. [:a, :b, c:].each do |e| it.index it.first? it.last? end T.