From: Gregory Seidman Date: 2006-04-03T20:47:56+09:00 Subject: Re: What does this hash do? Is this a hash? On Mon, Apr 03, 2006 at 06:34:50PM +0900, ts wrote: } >>>>> "r" == ralf writes: } } r> hash = Hash.new("") } r> => {} } r> hash["a"] << "b" } } When you write this : } 1) ruby return the default value for the hash ('a' don't exist as a key) } 2) concatenate "b" to this default value (see String#<<) } } Finally you have modified the default value for the hash, and you can see } this here : } } r> hash["alskj"] } r> => "b" } } ruby now give the new default value This has to be the most frequently asked question on this list. Why isn't it in the FAQ at http://www.rubygarden.org/faq/main/all ? } Guy Decoux --Greg