From: Jacob Fugal Date: 2006-06-30T06:16:26+09:00 Subject: Re: << for Hash? On 6/29/06, Dean Strelau wrote: > 3) Because of the way a Hash works, you can't add multiple values for the > same key, and this is how << is supposed to work. When you say > > [1,2,3,4] << 4 > => [1,2,3,4,4] #not [1,2,3,4] > The behavior here is what you would expect from something that "appends," > while Hash#<< doesn't do the same. Ah, but this is just how a Set works: require 'set' x = Set[ 1, 2, 3, 4 ] x << 4 p x # => #, not # And you didn't seem to have a problem with Set#<< earlier... ;) Jacob Fugal