def grep(pattern)
      filter("grep") do |yielder|
        each do |element|
          if pattern === element
            result = if block_given?
              yield element
            else
              element
            end
            yielder.call(result)
          end
        end
      end
    end
def grep(pattern)
      filter("grep") do |yielder|
        each do |element|
          if pattern === element
            result = if block_given?
              yield element
            else
              element
            end
            yielder.call(result)
          end
        end
      end
    end
Select elements matching a pattern.

 @return [Enumerable] elements for which the pattern matches

 @see ::Enumerable#grep