From: Robert Klemme Date: 2009-02-12T06:08:49+09:00 Subject: Re: Array#to_hash On 11.02.2009 16:19, Trans wrote: > Would any problems arise from extending Array with this? > > # Convert an array into an indexed hash. > # > # [:a,:b,:c].to_hash #=> {0=>:a,1=>:b,2=>:c} > # > def to_hash > h = {} > each_with_index do |v, i| > h[i] = v > end > h > end It is still the question that David has mentioned a few days ago: there are many reasonable ways for Array to Hash conversion and who decides which is the "standard" one which should go into Array#to_hash? Cheers robert