From: 7stud -- Date: 2007-09-03T20:47:03+09:00 Subject: Re: assigning to hash keys when there is a default value? unknown wrote: > The only possible explanation I can come up with, which I don't like, > is that: > > h[2] ||= 10 > > is being treated like: > > 5 = 5 || 10 > > which is just another can of worms. > I also considered that possibility. Does the trace output support that? I don't really know how to read the trace output, but it doesn't look like there are two calls to Hash#[] for each ||=. -- Posted via http://www.ruby-forum.com/.