From: Farhad Farzaneh Date: 2007-07-04T16:46:13+09:00 Subject: Re: Isn't hash default value behavior just a little bizarre? Pe単a, Botp wrote: > > ruby allows one to change the default value. that is good, imho. > i think the surprise stems fr the fact that it is _too simple to change > the default. hey, it's ruby ;) > > kind regards -botp You're right. Somehow I missed that in the documentation.... did RTFM, but obviously not carefully enough. Still, I do find it pretty surprising. I got stung when I was actually using the feature to initialize any entry to an array just to avoid the business of hash[key] ||= [] Lesson learned. -- Posted via http://www.ruby-forum.com/.