From: Phrogz Date: 2009-02-16T09:54:45+09:00 Subject: Re: Iterating a changing Hash under 1.9.1 On Feb 15, 5:07 pm, Charles Oliver Nutter wrote: > Phrogz wrote: > > I think you're wrong. > > Initial state: { 0=>0 } > > First loop: k is 0, a[0] is 1, assign h[1]=>1 > > A brand new key/value has been inserted to the hash this point. > > If #each then covered the next key/value pair: > > Second loop: k is 1, a[1] is 2, assign h[2]=>2 (and so on) > > There are a maximum of four keys possible and you never remove any. The > second time through you're reassigning keys that are already there from > the first time. I'm confused. As far as I can tell, the hash starts with 1 key, and ends up with 2. What 'first time' are the keys being set?