From: Russell Norris Date: 2007-09-03T20:38:27+09:00 Subject: Re: assigning to hash keys when there is a default value? I don't think this is a bug, kittens. since h[2] returns a value [eventhough it's not set], it causes h[2] to evaluate so the assignmentnever happens. x ||= y just means give me x or set x to y if there'sno value for x. h[2] _does_ have a value if only a default one. just my two cents. unless i missed the point here, in which case i apologize for my hastyconclusion. :)) RSL On 9/3/07, 7stud -- wrote:> Pe単a, Botp wrote:> > pls refer to the hash#new document.> >>> I also have "Programming Ruby (2nd ed)", and I read the documentation> therein for Hash.new many times before posting--which is the same> documentation that ri produces.>> --> Posted via http://www.ruby-forum.com/.>>