From: benny Date: 2004-01-28T02:09:56+09:00 Subject: Re: newbee question about "missing" hash methods +, += and << Am Wed, 28 Jan 2004 01:39:01 +0900 schrieb ts : > >>>>> "H" == Hal Fulton writes: > > H> In other words, I expect + to be commutative always. But probably > H> someone will now show me a case where it is not in Ruby. :) > > ruby -e 'p [1]+[2]==[2]+[1]' > > > Guy Decoux > > > > > conclusion: no argument against "<<" / "+" for hashs? and "delete" is even more obscure when we have "-" : e.g. testhash = {"key" => "value", "other key" => "other entry"} otherhash = {"other key" => "other entry"} testhash - "key" #-> {"other key" => "other entry"} # should delete the entry with the key "key" testhash - otherhash #-> {} # should delete the corresponding entry as well I think this is far more intuitive and flexible