From: Yukihiro Matsumoto Date: 2005-07-11T10:58:57+09:00 Subject: Re: accessing index inside map Hi, In message "Re: accessing index inside map" on Mon, 11 Jul 2005 10:50:31 +0900, "Pe�a, Botp" writes: |# (1..6).each_with_index.map{|x,i|[2,5].include?(i) ? x : x*2} |# |#then. It's much simpler isn't it? |but isn't | each_with_index.map | |so close to being | map_with_index | |? Yes. But when we add map_with_index, we might be asked to add collect_with_index, detect_with_index, inject_with_index, and all other enumerable methods _with_index as well. matz.