From: Ryan Leavengood Date: 2005-07-11T14:09:41+09:00 Subject: Re: accessing index inside map nobuyoshi nakada wrote: > > What about Enumerator#with_index? > > [1,2,3,4,5,6].map.with_index {|x,i|[2,5].include?(i) ? x : x*2} I like that, personally. In fact each_with_index could become each.with_index (though we obviously need the old one for backwards compatibility.) Ryan