From: Trans Date: 2009-02-13T09:09:18+09:00 Subject: Re: Array#to_hash On Feb 12, 2:08 am, "William James" wrote: > a = [:a,:b,:c] >     ==>[:a, :b, :c] > h = a.to_hash >     ==>{0=>:a, 1=>:b, 2=>:c} > a[2] >     ==>:c > h[2] >     ==>:c > > Wow!  That *is* a big improvement! Ha ha. Very funny. It may seem silly, but "identity principles" often do. You know like, a + 0 = a. How useful does that seem? But it is. In this, you might want to do something like: a = [:a,:b,:c] h = a.to_hash h[0.5] = :x h[1.5] = :y h[2.5] = :z # ... etc ... a = h.sort.map{|k,v|v} T.