From: Haruka YAGNI Date: 2011-03-09T14:05:43+09:00 Subject: Re: Unexpected problem: hash[key] << value On Wed, Mar 9, 2011 at 12:45 PM, Joey Zhou wrote: > I think use "<<" maybe intuitive, but the result is unexpected. What's > wrong with it? Hash.default refers to the same Array at each element. You cannot use the first code, because "<<" changes the default array, not each element. Here is a good example from the manual, but it is Japanese... sorry http://www.ruby-lang.org/ja/man/html/trap_Hash.html -- Haruka YAGNI hyagni@gmail.com