From: "Marcel Molina Jr." Date: 2006-03-29T22:10:52+09:00 Subject: Re: 'select' semantics On Wed, Mar 29, 2006 at 05:40:54PM +0900, Srinivas Jonnalagadda wrote: > Thank you for pointing out the chained 'select'! > > Allow me to apologize for the incorrect problem statement. > > The issue is actually not with downstream 'select's, but with other > calls that assume a hash-like behaviour on the part of the container. > > Examples include Hash#[] and Hash#each_value. It's not pretty but...: >> h = { 0 => 0, 1 => 2, 2 => 3, 4 => 4 } => {0=>0, 1=>2, 2=>3, 4=>4} >> Hash[*h.select { |k,v| k % 2 == 0 }.flatten].each_value {|v| p v} 0 3 4 => {0=>0, 2=>3, 4=>4} marcel -- Marcel Molina Jr.