From: Martin DeMello Date: 2005-10-30T19:42:06+09:00 Subject: Re: Cleaner syntax for .map (is there already a way, or ruby2 idea?) Simon Strandgaard wrote: > > ary = %w(a b c d e) > > ary.xmap(:upcase, :gsub) > > p ary[0].upcase # "A" > p ary.upcase # ["A", "B", "C", "D", "E"] > p ary.gsub(/[bd]/, 'X') # ["a", "X", "c", "X", "e"] I don't like that one, because it provides no visual distinction between methods that act on the array as a whole and methods that map over it. Would be a nice place to introduce the -> operator, though :) martin