From: nobuyoshi nakada Date: 2005-07-08T17:22:55+09:00 Subject: Re: accessing index inside map Hi, At Fri, 8 Jul 2005 16:30:22 +0900, Pe�a, Botp wrote in [ruby-talk:147536]: > i'd like to double the element values except those loc on the 2nd and 5th > indices eg. $ ruby -renumerator -e 'p (1..6).enum_for(:each_with_index).map{|x,i|[2,5].include?(i) ? x : x*2}' [2, 4, 3, 8, 10, 6] -- Nobu Nakada