From: Martin DeMello Date: 2005-07-09T06:40:48+09:00 Subject: Re: accessing index inside map Yukihiro Matsumoto wrote: > > We have vague plan to make enumerating method to return Enumerator > when no block is given in the future, so that > > require 'enumerator' > (1..6).enum_for(:each_with_index).map{|x,i|[2,5].include?(i) ? x : x*2} > > would be > > (1..6).each_with_index.map{|x,i|[2,5].include?(i) ? x : x*2} > > then. It's much simpler isn't it? Wow - I'd love to see that. Any potential drawbacks? martin