anchor.diff:      ].
   
   
  -gen_gen(Mod, ErlMod, Def) ->
  -    Name = piqdef_name(Def),
  -    ErlName = piqdef_erlname(Def),
  +gen_gen(Mod, ErlMod, Name, ErlName) ->
       [
           "gen_", ErlName, "(X, Format) ->\n",
           "    Iolist = ", ErlMod, ":gen_", ErlName, "(X),\n",
  
positive.code:     Mod = Piqi#piqi.module,
      ErlMod = Piqi#piqi.erlang_module,
      Defs = Piqi#piqi.piqdef,
  
      Filename = binary_to_list(ErlMod) ++ "_ext.erl",
  
  
negative.code:     ].
  
  
  gen_parse_def(Mod, ErlMod, Def) ->
      Name = piqdef_name(Def),
      ErlName = piqdef_erlname(Def),
      gen_parse(Mod, ErlMod, Name, ErlName).
  
  
  gen_gen_def(Mod, ErlMod, Def) ->
      Name = piqdef_name(Def),
      ErlName = piqdef_erlname(Def),
      gen_gen(Mod, ErlMod, Name, ErlName).
  
  
  gen_parse_func(Mod, ErlMod, Func) ->
      [ gen_parse(Mod, ErlMod, Name, ErlName) || {Name, ErlName} <- make_params(Func) ].
  
  
  gen_gen_func(Mod, ErlMod, Func) ->
      [ gen_gen(Mod, ErlMod, Name, ErlName) || {Name, ErlName} <- make_params(Func) ].
  
  
  make_params(Func) ->
      Name = Func#func.name,
      ErlName = Func#func.erlang_name,
      [
          make_param_names(Name, ErlName, Func#func.input, "input"),
          make_param_names(Name, ErlName, Func#func.output, "output"),
          make_param_names(Name, ErlName, Func#func.error, "error")
      ].
  
  
  make_param_names(_Name, _ErlName, 'undefined', _ParamType) -> 'undefined';
  make_param_names(Name, ErlName, _Param, ParamType) ->
      {[Name, "-", ParamType], [ErlName, "_", ParamType]}.
  
  
  iod(_Delim, []) -> [];
  iod(Delim, [H|T]) ->
      lists:foldl(fun (X, Accu) -> [Accu, Delim, X] end, H, T).
  