On 6/29/06, Dean Strelau <dstrelau / gmail.com> 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
  # => #<Set: {1, 2, 3, 4}>, not #<Set: {1, 2, 3, 4, 4}>

And you didn't seem to have a problem with Set#<< earlier... ;)

Jacob Fugal