From: gotoken@... (GOTO Kentaro) Date: 2001-01-04T04:34:51+09:00 Subject: [ruby-talk:8587] Re: bug?? In message "[ruby-talk:8580] bug??" on 01/01/04, Jean Michel writes: >irb(main):015:0> a=Hash.new("") >{} >irb(main):016:0> a[1]<<"a" >"a" >irb(main):017:0> a[1] >"a" >irb(main):018:0> a >{} Then you can get: irb(main):019:0> a.default "a" And see Hugh's answer [ruby-talk:8582]. A number of users was confused by these behavior, thus we have already proposed an alternative constructor [ruby-list:26622] like this: a = Hash.new { |hash_self, unknown_key| hash_self[unknown_key] = "" } a[1] << "a" p a # {1 => "a"} I believe this feature will be adopted in the near future ;-) -- Gotoken