From: Alex Young Date: 2007-11-29T06:02:51+09:00 Subject: Re: *hash is different from hash.to_a? Trans wrote: > Has this come up before? I don;t recall. But just the same. Does this > seem inconsistent to you? > > irb(main):003:0> a = *{:a=>1} > => [:a, 1] > irb(main):004:0> a = *{:a=>1,:b=>2} > => [[:b, 2], [:a, 1]] > > vs. > > irb(main):006:0> a = {:a=>1}.to_a > => [[:a, 1]] > irb(main):007:0> a = {:a=>1,:b=>2}.to_a > => [[:b, 2], [:a, 1]] Not really inconsistent - * unwraps its argument if it can. Observe: irb(main):001:0> a = *[1,2] => [1, 2] irb(main):002:0> a = *[1] => 1 -- Alex