From: dblack@... Date: 2007-01-08T10:59:04+09:00 Subject: Re: a most undangerous Hash#store! Hi -- On Mon, 8 Jan 2007, Florian Gross wrote: > On 2007-01-08 02:00:10 +0100, dblack@wobblini.net said: > >> hsh[:key] = "value" unless hsh.has_key? :key >> You can use merge and a one-key hash: >> >> hash.merge({ :key => "new value" }) > > Hm, not really: > > { :key => "old value" }.merge({ :key => "new value" }) # => {:key=>"new > value"} True -- that's a bit of a deal-breaker :-) David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)