anchor.diff:  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %%% the print_loop process
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  +
   print_init(PrintFun) ->
     print_loop(PrintFun, 0, running).
   
  
positive.code: improper_map(F, [A|B]) when not is_list(B) -> [F(A)|F(B)];
  improper_map(F, [A|B]) -> [F(A)|improper_map(F, B)].
  
  mk_out(#cnf{print_re=RE, print_file=File}) ->
    FD = get_fd(File),
    fun(F, A) ->
        Str=flat(F, A),
        case RE =:= "" orelse re:run(Str, RE) =/= nomatch of
          true  -> io:fwrite(FD, "~s~n", [Str]);
          false -> ok
        end
    end.
  
  get_fd(FD) when is_atom(FD); is_pid(FD) ->
    FD;
  get_fd("") ->
    standard_io;
  get_fd(FN) ->
    case file:open(FN, [write]) of
      {ok, FD} -> FD;
      _ -> throw({cannot_open, FN})
    end.
  
  fix_ts(MS, TS) ->
  
negative.code:     recv -> N+1;
      _    -> N
    end.
  
  spawn_printer(PrintFun, Cnf) ->
    Cnf#cnf{print_pid=spawn_link(fun() -> print_init(PrintFun) end)}.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% the default print fun for blocking mode (i.e. return a term).
  