From: Trans Date: 2007-06-22T04:20:19+09:00 Subject: Re: Behaviour of Enumerables reject vs. select mixed into Hash > On 6/21/07, Rob Biedenharn wrote: > > > What no one seems to have (directly) focussed on is that Hash#each > > gives two-element [k,v] arrays back as the content. That's right. And if you wanted things to be "just ducky", it would have to give only the v. I've actually argued in favor of that before, b/c it's not unreasonable to see that an Array index is like a Hash key. So, for a full parallel we'd need to see something like: {:x=>'m'}.each { |v| v #=> 'm' ['m'].each { |v| v #=> 'm' {'x'=>'m'}.each_assoc{ |a| a #=> ['x','m'] ['m'].each_assoc{ |a| a #=> [0,'m'] One could easily argue that an Assoc class would be quite useful here, rather than relying on 2-element Array to fulfill the roll. With that in hand, it would re easy enough to add the #<< method for enumerable construction. T.