anchor.diff:        %% find in macros/functions of current namespace
         Namespace = maps:get(namespace, Env),
         Locals = kapok_symbol_table:namespace_locals(Namespace),
  -      case find_fa(FunArity, Locals) of
  +      case filter_fa(FunArity, Locals) of
           [{F, A, P}] -> {F, A, P};
           [] -> false
         end
  
positive.code:          find_local_function/3,
           get_remote_function/4,
           find_remote_function/4,
           find_fa/2,
           expand_macro_named/6,
           format_error/1
          ]).
  
negative.code:   end.
  
  find_optional_dispatch(Meta, Module, FunArity, Env) ->
    FunImports = orddict:from_list([{Module, get_optional_functions(Module)}]),
    MacroImports = orddict:from_list([{Module, get_optional_macros(Module)}]),
    do_find_dispatch(Meta, FunArity, FunImports, MacroImports, Env).
  
  find_dispatch(Meta, Module, FunArity, Env) ->
    Env1 = ensure_uses_imported(Env),
    %% TODO check whether module is a require alias
    FunList = case orddict:find(Module, ?m(Env1, functions)) of
                                     {ok, L1} -> L1;
                                     error -> []
            end,
    FunImports = orddict:from_list([{Module, FunList}]),
    MacroList = case orddict:find(Module, ?m(Env1, macros)) of
                  {ok, L2} -> L2;
                  error -> []
                end,
    MacroImports = orddict:from_list([{Module, MacroList}]),
    do_find_dispatch(Meta, FunArity, FunImports, MacroImports, Env1).
  
  find_dispatch(Meta, FunArity, Env) ->
    Env1 = ensure_uses_imported(Env),
    do_find_dispatch(Meta, FunArity, ?m(Env1, functions), ?m(Env1, macros), Env1).
  
  do_find_dispatch(Meta, {Fun, Arity} = FunArity, FunImports, MacroImports, Env) ->
    FunMatch = filter_import(FunArity, FunImports),
    MacroMatch = filter_import({Fun, Arity}, MacroImports),
    case {FunMatch, MacroMatch} of
      {[], [Match]} ->
        {M, [{F, A, P}]} = Match,
        {{macro, {M, F, A, P}}, Env};
      {[Match], []} ->
        {M, [{F, A, P}]} = Match,
        {{function, {M, F, A, P}}, Env};
      {[], []} ->
        {false, Env};
      _ ->
        [First, Second | _T] = FunMatch ++ MacroMatch,
        Error = {ambiguous_call, {Fun, Arity, First, Second}},
        kapok_error:form_error(Meta, ?m(Env, file), ?MODULE, Error)
    end.
  
  filter_import(FunArity, List) when is_list(List) ->
    lists:foldl(fun({Module, Imports}, Acc) ->
                    case filter_fa(FunArity, Imports) of
                      [] -> Acc;
                      R -> orddict:store(Module, R, Acc)
                    end
  