anchor.diff:  -define(SEPARATOR, $\/).
   -define(MATCH_ALL, '*').
   
  -%% @spec dispatch(Path::string(), DispatchList::[matchterm()]) ->
  +%% @spec wm_dispatch(Host::atom(), Path::string(), DispatchList::[matchterm()]) ->
   %%                                            dispterm() | dispfail()
   %% @doc Interface for URL dispatching.
   %% See also http://bitbucket.org/justin/webmachine/wiki/DispatchConfiguration
  -dispatch(PathAsString, DispatchList) ->
  +wm_dispatch(Host, PathAsString, DispatchList) ->
       Path = string:tokens(PathAsString, [?SEPARATOR]),
       % URIs that end with a trailing slash are implicitly one token
       % "deeper" than we otherwise might think as we are "inside"
  
positive.code: 		     true -> 1;
  		     _ -> 0
  		 end,
      try_path_binding(DispatchList, Path, [], ExtraDepth).
  
  try_path_binding([], PathTokens, _, _) ->
      {no_dispatch_match, PathTokens};
  try_path_binding([{DispatchName, PathSchema, Mod, Props}|Rest], PathTokens, Bindings, ExtraDepth) ->
      case bind(PathSchema, PathTokens, Bindings, 0) of
          {ok, Remainder, NewBindings, Depth} ->
              {DispatchName, Mod, Props, Remainder, NewBindings, calculate_app_root(Depth + ExtraDepth), reconstitute(Remainder)};
          fail -> 
              try_path_binding(Rest, PathTokens, Bindings, ExtraDepth)
      end.
  
  bind([], [], Bindings, Depth) ->
      {ok, [], Bindings, Depth};
  bind([?MATCH_ALL], Rest, Bindings, Depth) when is_list(Rest) ->
      {ok, Rest, Bindings, Depth + length(Rest)};
  bind(_, [], _, _) ->
      fail;
  bind([Token|RestToken],[Match|RestMatch],Bindings,Depth) when is_atom(Token) ->
      bind(RestToken, RestMatch, [{Token, Match}|Bindings], Depth + 1);
  bind([Token|RestToken], [Token|RestMatch], Bindings, Depth) ->
      bind(RestToken, RestMatch, Bindings, Depth + 1);
  bind(_, _, _, _) ->
      fail.
  
  reconstitute([]) -> "";
  
negative.code: %%                                  {stop, Reason, State}
  %% @doc Load a new set of dispatch rules.
  handle_cast({set_dispatch_rules, Rules}, State) ->
      {noreply, State#state{rules=compile_regexps_hosts(Rules)}};
  
  %% @doc Trap unknown casts
  handle_cast(Message, State) ->
  