# File lib/rgen/util/pattern_matcher.rb, line 139
  def find_pattern_internal(env, name, *connection_points)
    proxied_args = connection_points.collect{|a| 
      a.is_a?(RGen::MetamodelBuilder::MMBase) ?  Proxy.new(a) : a }
    bindables = create_bindables(name, connection_points)
    pattern_root = evaluate_pattern(name, TempEnv, proxied_args+bindables)
    candidates = candidates_via_connection_points(pattern_root, connection_points)
    candidates ||= env.find(:class => pattern_root.class)
    candidates.each do |e|
      # create new bindables for every try, otherwise they can could be bound to old values

      bindables = create_bindables(name, connection_points) 
      pattern_root = evaluate_pattern(name, TempEnv, proxied_args+bindables)
      matched = match(pattern_root, e)
      return Match.new(e, matched, bindables.collect{|b| b._value}) if matched 
    end
    nil
  end