anchor.diff:  	   {struct, [{<<"l">>,{array, []}}]}}, Y).
   
   valid_rpc_test(Y) ->
  -    %% try begin
  -    %% 	    dbg:tracer(),
  -    %% 	    dbg:tpl(?MODULE,validate_rpc_request,x),
  -    %% 	    dbg:p(all,[c]),
       {ok, [
   	  {a, 17, [{{<<"y">>,<<"foo">>},_,<<"in_a">>,_},
   		   {type,_,<<"uint32">>,[]},
  
positive.code: 	    throw({invalid_params, {wrong_type, [Key, Value, Type]}})
      end.
  
  keytake(A, L) ->
      keytake(A, L, []).
  
  keytake(A, [{K,_} = H|T], Acc) ->
      case comp(A,K) of
  	true ->
  	    {H, lists:reverse(Acc) ++ T};
  	false ->
  	    keytake(A, T, [H|Acc])
      end;
  keytake(_, [], _) ->
      false.
  
  comp(A, A) -> true;
  
negative.code: 	_ when Stmt==leaf ->
  	    case lists:keyfind(default, 1, Info) of
  		{_, Def} ->
  		     validate_rpc_request(
  		       Elems, Data,
  		       [{to_atom(Key), Def, Info}|Acc], Meta);
  		false ->
  		    validate_rpc_request(Elems, Data, Acc, Meta)
  	    end;
  	_ ->
  	    %% FIXME: check whether this is in fact the right action for all
  	    %% non-leaf statements
  	    validate_rpc_request(Elems, Data, Acc, Meta)
      end.
  
  also_missing(Elems, Env, Data) ->
      also_missing(Elems, Data ++ Env).
  
  also_missing([{Stmt,_,Key,I}|T], Data) ->
      case (req_mandatory(Stmt, I) andalso not_in_data(Key, Data)) of
  	true ->
  	    [Key|also_missing(T, Data)];
  	false ->
  