anchor.diff:    end.
   
   getter(Tab,Key) ->
  -  case ets:lookup(Tab,Key) of
  -    [{Key,Res}] ->
  +  case ets:select(Tab,[{{Key,'_'},[],['$_']}]) of
  +    [{_,Res}] ->
         case is_integer(Res) of
           true -> integer_to_list(Res);
           false-> Res
  
positive.code:   [binary_to_list(K) || {K,<<"true">>} <- headers(Req)].
  
  ets({keys,Tab})       -> ets:foldr(fun({K,_},A)->[K|A]end,[],tab(Tab));
  ets({insert,Tab,K,V}) -> inserter(tab(Tab),{l2b(K),V});
  ets({insert,Tab,KVs}) -> ets:insert(tab(Tab),unpack(KVs));
  ets({counter,Tab,Key})-> update_counter(tab(Tab),l2b(Key));
  ets({reset,Tab,Key})  -> ets:insert(tab(Tab),{l2b(Key),0}),"0";
  ets({get,Tab,Key})    -> getter(tab(Tab),l2b(Key));
  ets({delete,Tab,Key}) -> ets:delete(tab(Tab),l2b(Key)).
  
  inserter(Tab,{K,V}) ->
    case ets:insert_new(Tab,{K,V}) of
  
negative.code: 
  reply(Req) ->
    case {method(Req),uri(Req),true_headers(Req)} of
      {"PUT",   [Tab|KeyL],["counter"]} -> ets({counter,Tab,KeyL});
      {"PUT",   [Tab|KeyL],["reset"]}   -> ets({reset,Tab,KeyL});
      {"PUT",   [Tab|KeyL],[]}          -> je(ets({insert,Tab,KeyL,body(Req)}));
      {"PUT",   [Tab]    ,[]}           -> je(gcall({create,Tab}));
      {"GET",   [[]]     ,[]}           -> je([l2b(T)||T<-gcall({all,[]})]);
      {"GET",   [Tab]    ,[]}           -> je(ets({keys,Tab}));
      {"GET",   [Tab|KeyL],[]}          -> ets({get,Tab,KeyL});
      {"POST",  [Tab]    ,[]}           -> je(ets({insert,Tab,body(Req)}));
      {"DELETE",[Tab]    ,[]}           -> je(gcall({delete,Tab}));
      {"DELETE",[Tab|KeyL],[]}          -> je(ets({delete,Tab,KeyL}));
      X                                 -> throw({404,X})
    end.
  
  body(Req) ->
  