From: Yusuke ENDOH Date: 2011-01-05T21:45:34+09:00 Subject: [ruby-core:34101] Re: Hash#select and Hash#reject bug in 1.9.2? Hi, 2011/1/5 Lin Jen-Shin : > In terms of compatibility, I think it might be better to change > actually, > because 1.8.7 is consistent here. Hmm. At r13809, matz changed Hash#each to use yield([k, v]) instead of yield(k, v). http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=13809 Matz, did you intend this behavior change that Lin reported? > On the other hand, I wonder if > anyone is depending on `hash.select{ |(k, v)| }' while v is nil? Though I may be too serious, I think of: h = { [1, 2] => "foo", [1, 3] => "bar", [2, 3] => "baz", } h = h.select {|(k1, k2)| (k1 + k2).odd? } p h #=> {[1, 2]=>"foo", [2, 3]=>"baz"} -- Yusuke Endoh