From: benny Date: 2004-01-28T02:39:58+09:00 Subject: Re: newbee question about "missing" hash methods +, += and << Am Wed, 28 Jan 2004 02:22:05 +0900 schrieb ts : > >>>>> "b" == benny writes: > > b> conclusion: no argument against "<<" / "+" for hashs? > > Well, it's more : no arguments for Hash#<< and Hash#+ > > moulon% ruby -e 'p "aa"<<"bb"' > "aabb" > moulon% > > moulon% ruby -e 'p ["aa"]<<"bb"' > ["aa", "bb"] > moulon% > > Now try the same with an Hash (order is given by the hash value, and not > by the last element added) > I read somewhere that the result of the "shift" method is unpredictable because there is no fixed order in hashes so it shouldn't matter IMHO. or did I get you wrong? {"a" => "b"} << {"c" => "d"} #-> {"a" => "b", "c" => "d"} {"a" => "b"} << "c" #-> error > > Guy Decoux > >