anchor.diff:  
   %%-define(DEBUG,1).
   -ifdef(DEBUG).
  --define(dbg(Data),erlang:display(Data)).
  +-define(dbg(Data),ct:pal("~p",[Data])).
   -else.
   -define(dbg(Data),noop).
   -endif.
  
positive.code: 	    exit(Reason)
      end.
  
  toerl_loop(Port,Acc) ->
      ?dbg({toerl_loop, Port, Acc}),
      receive
  	{Port,{data,{Tag0,Data}}} when is_port(Port) ->
  	    ?dbg({?LINE,Port,{data,{Tag0,Data}}}),
  	    case Acc of
  		[{noeol,Data0}|T0] ->
  		    toerl_loop(Port,[{Tag0, Data0++Data}|T0]);
  		_ ->
  		    toerl_loop(Port,[{Tag0,Data}|Acc])
  	    end;
  	{Pid,{get_line,Timeout}} ->
  	    case Acc of
  		[] ->
  		    case get_data_within(Port,Timeout,[]) of
  			timeout ->
  			    Pid ! {get_line, timeout},
  			    toerl_loop(Port,[]);
  			{noeol,Data1} ->
  			    Pid ! {get_line, timeout},
  			    toerl_loop(Port,[{noeol,Data1}]);
  			{eol,Data2} ->
  			    Pid ! {get_line, Data2}, 
  			    toerl_loop(Port,[])
  		    end;
  		[{noeol,Data3}] ->
  		    case get_data_within(Port,Timeout,Data3) of
  			timeout ->
  			    Pid ! {get_line, timeout},
  			    toerl_loop(Port,Acc);
  			{noeol,Data4} ->
  			    Pid ! {get_line, timeout},
  			    toerl_loop(Port,[{noeol,Data4}]);
  			{eol,Data5} ->
  			    Pid ! {get_line, Data5},
  			    toerl_loop(Port,[])
  		    end;
  		List ->
  		    {NewAcc,[{eol,Data6}]} = lists:split(length(List)-1,List),
  		    Pid ! {get_line,Data6},
  		    toerl_loop(Port,NewAcc)
  	    end;
  	{Pid, {send_line, Data7}} ->
  	    Port ! {self(),{command, Data7++"\n"}},
  	    Pid ! {send_line, ok},
  	    toerl_loop(Port,Acc);
          {Pid, {send_data, Data}} ->
              Port ! {self(),{command, Data}},
  	    Pid ! {send_data, ok},
  	    toerl_loop(Port,Acc);
          {Pid, {kill_emulator_command, Cmd}} ->
              put(kill_emulator_command, Cmd),
              Pid ! {kill_emulator_command, ok},
  	    toerl_loop(Port,Acc);
  	{_Pid, kill_emulator} ->
              case get(kill_emulator_command) of
                  undefined ->
                      Port ! {self(),{command, "init:stop().\n"}};
                  sigint ->
                      Port ! {self(),{command, [3]}},
                      timer:sleep(200),
                      Port ! {self(),{command, "a\n"}}
              end,
  	    Timeout1 = timeout(long),
  
negative.code:     {error, cannot_to_erl};
  try_to_erl(Command, N) ->
      ?dbg({?LINE,N}),
      Port = open_port({spawn, Command},[eof]),
      Timeout = timeout(short) div 2,
      receive
  	{Port, eof} ->
              timer:sleep(Timeout),
  	    try_to_erl(Command, N-1)
      after Timeout ->
  	    ?dbg(Port),
  