On Tue, Dec 06, 2011 at 01:40:17AM +0900, Jes?s Gabriel y Gal?n wrote:
> 
> Using that Hash constructor, what you pass is the default value for a
> missing key. What this means is that the hash will return that object
> to any call in which the key is not found. *But* it won't assign that
> default object to the key. You have to do that yourself. The other
> effect you are seeing is that the default object is returned for all
> missing keys, hence the {2 => true} for foo[2].

I find it rather surprising that assignment does not create something new
where the default used to appear, and kind of useless in this context.  I
know it's a special case of assignment that causes this to occur, now
that I think about it after reading replies to my original email, but it
seems like a strange way to implement things from a language user
perspective.

Thanks to everybody who responded.