From: "Kroeger, Simon (ext)" Date: 2006-04-13T21:58:47+09:00 Subject: Re: map_if, collect_if ??? > > module Enumerable > > def map_if( &block ) > > find_all(&block).map(&block) > > end > > end > [...] > I will file away the find_all {}.map {} idiom for future use > [...] I would change that to: map(&block).select{|e|e} there can be surprising side effects if the user doesn't expect the block to be called twice for each element. cheers Simon