Hi,

(12/02/01 18:14), ڧ ܧݧ wrote:
>> Try each_with_object.
> 
> Yeah, it is good :) though it have a long name. It's pity that 1.9.3 hadn't
> it.

It's long indeed, but 1.9.3 had it.

  $ ./ruby -v -e 'p((1..3).each_with_object({}){|x,a|a[x]=x+1})'
  ruby 1.9.3p0 (2011-10-30 revision 33569) [x86_64-darwin11.3.0]
  {1=>2, 2=>3, 3=>4}

-- 
Nobu Nakada