anchor.diff:    %% Now that we have all the fn info we re-analyze the methods
     %% with the associated var, so that a recursive
     %% call can be correctly resolved.
  -  VarMeta = #{ 'variadic?'     => IsVariadic
  -             , max_fixed_arity => MaxFixedArity
  -             , variadic_arity  => VariadicArity
  -             },
  -  DefVar1 = clj_core:with_meta(DefVar, VarMeta),
  -  Env3    = clj_env:update_var(Env2, DefVar1),
   
     {MethodsExprs1, Env4} =
  -    analyze_fn_methods(Env3, MethodsList, LoopId, IsOnce, true),
  +    case IsDef of
  +      true  -> 
  +        VarMeta = #{ 'variadic?'     => IsVariadic
  +                   , max_fixed_arity => MaxFixedArity
  +                   , variadic_arity  => VariadicArity
  +                   },
  +        DefVar1 = clj_core:with_meta(DefVar, VarMeta),
  +        Env3    = clj_env:update_var(Env2, DefVar1),
  +
  +        analyze_fn_methods(Env3, MethodsList, LoopId, IsOnce, true);
  +      false -> 
  +        {MethodsExprs, Env2}
  +    end,
  +
   
     FnExpr = #{ op              => fn
               , env             => ?DEBUG(Env)
  
positive.code: 
  -spec macroexpand_1(clj_env:env(), 'clojerl.List':type()) -> any().
  macroexpand_1(Env, Form) ->
    Op = clj_core:first(Form),
    {MacroVar, Env1} = lookup_var(Op, false, Env),
  
    case
      is_special(Op)
      orelse (not clj_core:'symbol?'(Op))
      orelse (MacroVar == undefined)
      orelse (not 'clojerl.Var':is_macro(MacroVar))
    of
      true -> Form;
      false ->
        {MacroVar, Env2} = lookup_var(Op, false, Env1),
        Var = clj_core:deref(MacroVar),
        Args = [Form, Env2] ++ clj_core:seq(clj_core:rest(Form)),
        clj_core:invoke(Var, Args)
    end.
  
  -spec macroexpand(clj_env:env(), 'clojerl.List':type()) -> any().
  
negative.code:                   false -> clj_core:seq2(Methods)
                  end,
  
    Env0 = clj_env:add_locals_scope(Env),
  
    %% Add the name of the fn as a local with a modified name so that we can
    %% identify the fun as a clojure function when evaluated with erl_eval
    %% (see clojerl.erlang.Fn)
    PrefixNameSym = 'clojerl.erlang.Fn':prefix(NameSym),
    LocalExpr     = #{op => local, name => PrefixNameSym},
  
    %% If there is a def var we add it to the local scope
    DefNameSym  = get_def_name(Env),
    IsDef       = DefNameSym =/= undefined,
    DefVar      = case IsDef of
                    true  -> 
                      DefVarNsSym = clj_env:current_ns(Env),
                      'clojerl.Var':new( clj_core:name(DefVarNsSym)
                                       , clj_core:name(DefNameSym)
                                       );
                    false -> undefined
                  end,
  
    %% If it is a def we only register the var, otherwise register the local.
    Env1 = case IsDef of
             true  -> 
               clj_env:update_var(Env0, DefVar);
             false -> 
               clj_env:put_local(Env0, NameSym, LocalExpr)
           end,
  
    OpMeta      = clj_core:meta(Op),
    OnceKeyword = clj_core:keyword(<<"once">>),
  