anchor.diff:  %%                                      {stop, Reason, State}
   %% Description: Handling call messages
   %% @doc Create the url for the dispatch rule with name and arguments Args.
  -handle_call({'url_for', Name, Args, Escape}, _From, State) ->
  -    Uri = make_url_for(Name, Args, Escape, State#state.lookup),
  +handle_call({'url_for', Name, Args, Defaults, Escape}, _From, State) ->
  +    Uri = make_url_for(Name, Args, Escape, State#state.lookup, Defaults),
       {reply, Uri, State};
   
   %% @doc Return the preferred hostname for the site
  
positive.code:                   end,
              [Uri, $?, urlencode(QueryStringArgs, Sep)]
      end;
  make_url_for1(Args, [Pattern|T], Escape, Best) ->
      Best1 = select_best_pattern(Args, Pattern, Best),
      make_url_for1(Args, T, Escape, Best1).
  
  
  select_best_pattern(Args, {PCount, PArgs, Pattern}, Best) ->
      if 
          length(Args) >= PCount ->
              %% Check if all PArgs are part of Args
              {PathArgs, QueryStringArgs} = lists:partition(
                                              fun
                                                  ({star,_}) -> lists:member('*', PArgs);
                                                  ({A,_}) -> lists:member(A, PArgs) 
                                              end, Args),
              case length(PathArgs) of
                  PCount ->
                      % Could fill all path args, this match satisfies
                      select_best_pattern1({QueryStringArgs,Pattern}, Best);
                  _ ->
                      % Could not fill all path args, try other patterns
                      Best
              end;
          true ->
              Best
  
negative.code:                         Args1,
                          Qs)
      end.
  
  %% @spec List the default arguments for any dispatch rule, these are extracted from the request context.
  default_args(Context) ->
      [{language, z_context:language(Context)}].
  
  %% @spec Append all varargs argument, names are given in a list.
  append_varargs(Args, Context) ->
      case proplists:get_value(varargs, Args) of
          undefined ->
              Args;
          Varargs ->
              append_varargs(Varargs, proplists:delete(varargs, Args), Context)
      end.
  
  append_varargs([], Args, _Context) ->
      Args;
  append_varargs([{Name, Value}|Varargs], Args, Context) ->
      append_varargs(Varargs, append_vararg(Name, Value, Args), Context);
  append_varargs([[Name, Value]|Varargs], Args, Context) ->
      append_varargs(Varargs, append_vararg(Name, Value, Args), Context);
  append_varargs([Name|Varargs], Args, Context) ->
      Key = z_convert:to_atom(Name),
      append_varargs(Varargs, append_vararg(Key, z_context:get(Key, Context), Args), Context).
  
  append_vararg(Name, Value, Args) ->
      Key = z_convert:to_atom(Name),
      case proplists:is_defined(Key, Args) of
          true -> Args;
          false -> [{Key, Value}|Args]
      end.
  