anchor.diff:  start() ->
     spawn(?MODULE, fileed, [[], 0]).
   
  -append(Pid, Line) ->
  -  Pid ! {self(), {append, Line}},
  -  receive
  -    {Pid, Msg} -> Msg
  -  after 3000 -> timeout
  +sendRecv(Pid, Cmd) ->
  +  sendRecv(Pid, Cmd, undef).
  +sendRecv(Pid, Cmd, Arg) ->
  +  Pid ! {self(), {Cmd, Arg}},
  +  receive {Pid, Msg} -> Msg
  +  after 2000 -> timeout
     end.
  +
  +%append(Pid, Line) ->
  +%  sendRecv(Pid, append, Line).
  +
  +delete(Pid) ->
  +  sendRecv(Pid, delete).
  +
  +list(Pid) ->
  +  sendRecv(Pid, list).
  +
  +print(Pid) ->
  +  sendRecv(Pid, print).
  +
  +lineCount(Pid) ->
  +  sendRecv(Pid, lineCount).
  +
  +setLineNumber(Pid, Num) ->
  +  sendRecv(Pid, setLineNumber, Num).
  +
   
   append(Pid) ->
     L = io:get_line(""),
     case L of
       ".\n" -> quit;
  -    _ -> append(Pid, L),
  +    _ -> sendRecv(Pid, append, L),
            append(Pid)
     end.
   
  -pop(Pid) ->
  -  Pid ! {self(), {pop, undef}},
  -  receive
  -    {Pid, Msg} -> Msg
  -  after 3000 -> timeout
  -  end.
  -
  -list(Pid) ->
  -  Pid ! {self(), {list, undef}},
  -  receive
  -    {Pid, Msg} -> Msg
  -  after 3000 -> timeout
  -  end.
  -
  -printall(Pid) -> io:format(list(Pid)).
  -
  -print(Pid) ->
  -  Pid ! {self(), {print, undef}},
  -  receive
  -    {Pid, Msg} -> io:format(Msg)
  -  after 3000 -> timeout
  -  end.
  -
  -lineCount(Pid) ->
  -  Pid ! {self(), {lineCount, undef}},
  -  receive
  -    {Pid, Msg} -> Msg
  -  after 3000 -> timeout
  -  end.
   
   test() ->
     E = start(),
  
positive.code:       From ! {self(), ok},
        {A, B} = lists:split(Cursor, Lines),
        fileed(A ++ [Line] ++ B, Cursor + 1);
      {From, {pop, _}} ->
        From ! {self(), ok},
        fileed(lists:sublist(Lines, length(Lines)-1), Cursor);
      {From, {list, _}} ->
        From ! {self(), Lines},
        fileed(Lines, Cursor);
  
negative.code: numValid(E, Num) ->
    (Num > 0) and (Num =< lineCount(E)).
  
  getcmd(E) ->
    L = chomp(io:get_line(prompt())),
    case L of
      "q" -> {quit, E};
      "a" -> append(E),
             getcmd(E);
      ",p" -> io:format("~s", [list(E)]),
              getcmd(E);
      "p" -> io:format("~s", [print(E)]),
             getcmd(E);
      "d" -> delete(E),
             getcmd(E);
      _ -> Num = getnum(L),
           NumValid = numValid(E, Num),
           if NumValid ->
                setLineNumber(E, Num),
                getcmd(E);
              true ->
                unknown(),
  