anchor.diff:              'undefined' -> % the function doesn't produce output
   "                ok -> ok";
               _ ->
  -                OutputType = gen_param_typename(Context, F, "output"),
  +                EncodeFun = ["fun gen_", ErlName, "_output/1"],
                   [
   "                {ok, Output} ->\n"
  -"                    piqi_rpc_runtime:encode_output(?MODULE, fun ", ErlMod, ":gen_", OutputType, "/1, <<\"", ScopedName, "-output\">>, _OutputFormat, Output, Options)"
  +"                    piqi_rpc_runtime:encode_output(?MODULE, ", EncodeFun, ",\n"
  +"                       <<\"", ScopedName, "-output\">>, _OutputFormat, Output, Options)"
                   ]
           end,
   
  
positive.code:         case F#func.output of
              'undefined' -> "ok";
              _ ->
                  ErlTypeName = gen_param_typename(Context, F, "output"),
                  [ "{ok, ", ErlMod, ":default_", ErlTypeName, "()}" ]
          end,
  
      [ F#func.erlang_name, "(", Input, ") -> ", Output, ".\n\n" ].
  
  
negative.code:             'undefined' -> % the function doesn't produce errors
                  [];
              _ ->
                  ErrEncodeFun = ["fun gen_", ErlName, "_error/1"],
                  [[
  "                {error, Error} ->\n"
  "                    piqi_rpc_runtime:encode_error(?MODULE, ", ErrEncodeFun, ",\n",
  "                       <<\"", ScopedName, "-error\">>, _OutputFormat, Error, Options)"
                  ]]
          end,
  
  