From: Brian Candler Date: 2009-11-16T19:41:14+09:00 Subject: Re: Enumerable#find_yield, useful shortcut? better name? Unless I have misunderstood, I think there is an almost identical facility built-in: >> [1,2,3].find(lambda {-1}) { |x| x > 10 } => -1 It's slightly inconvenient to require a proc for the default, but it means you can create an 'expensive' object or modify the collection with a side-effect: >> a = [1,2,3] => [1, 2, 3] >> a.find(lambda{ a << 99; a.last }) { |x| x > 10 } => 99 >> a => [1, 2, 3, 99] >> -- Posted via http://www.ruby-forum.com/.