From: Dean Strelau Date: 2006-06-30T03:59:35+09:00 Subject: Re: << for Hash? ------=_Part_87949_10496634.1151607572709 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/29/06, Joel VanderWerf wrote: > That doesn't seem to stop Set#<< : > > irb(main):001:0> s = Set[1,2,3] > => # > irb(main):002:0> s << 4 > => # That's because the semantics make sense in the context of Set. Set acts like an unordered list, not like a Hash. There's certanily some hand-waiving going on to make << work with the Hash, but as has been shown, that's not too tough. IMO, appending '5' to a list of numbers {1,2,3,4} makes sense while appending a key/value pair doesn't. From the doc: 'Set implements a collection of unordered values with no duplicates. This is a hybrid of Array 's intuitive inter-operation facilities and Hash's fast lookup." || Dean ------=_Part_87949_10496634.1151607572709--