From: David Corbin Date: 2002-05-06T08:37:19+09:00 Subject: Re: Iterators and index Mike Stok wrote: >In article <3CD59857.9050807@imperitek.com>, David Corbin wrote: > > >>Please consider this fragment >> >>---frag 1--- >>list = ["Alpha", "Beta", "Gamma", "Delta" ] >> >>index=1 >>list.each() { |letter| doSomething(index,letter); index = index+1 } >>---end--- >> >>But, what I'd like to be able to do, is this. >>---frag 2--- >>list = ["Alpha", "Beta", "Gamma", "Delta" ] >> >>list.indexed_each() { |index,letter| doSomething(index+1,letter) } >>---end--- >> >> > >What about > > list.each_with_index { |letter, index| > doSomething(index + 1, letter) > } > >Hope this helps, > >Mike > Thanks. That's not in the Programming Ruby reference... Where is the "best" place to view built-in/standard class documentation?