From: Lin Jen-Shin Date: 2011-01-03T21:26:15+09:00 Subject: [ruby-core:34030] Hash#select and Hash#reject bug in 1.9.2? (sorry if this is a duplicated post, i forgot to subscribe) Block parameter with or without () is not consistent in select or reject, while each and map is consistent. Is this a bug? > ruby -v ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0] # each and map is consistent with or without () >> {a:1}.each{ |k,v| p [k,v].map(&:inspect) } [":a", "1"] >> {a:1}.each{ |(k,v)| p [k,v].map(&:inspect) } [":a", "1"] >> {a:1}.map{ |k,v| p [k,v].map(&:inspect) } [":a", "1"] >> {a:1}.map{ |(k,v)| p [k,v].map(&:inspect) } [":a", "1"] # select and reject is not consistent with or without () >> {a:1}.select{ |k,v| p [k,v].map(&:inspect) } [":a", "1"] >> {a:1}.select{ |(k,v)| p [k,v].map(&:inspect) } [":a", "nil"] >> {a:1}.reject{ |k,v| p [k,v].map(&:inspect) } [":a", "1"] >> {a:1}.reject{ |(k,v)| p [k,v].map(&:inspect) } [":a", "nil"] Thanks a lot! p.s. http://redmine.ruby-lang.org is down at the moment