anchor.diff:    Pid ! {self(), {append, Line}},
     receive
       {Pid, Msg} -> Msg
  -  after 3000 ->
  -    timeout
  +  after 3000 -> timeout
     end.
   
   append(Pid) ->
  
positive.code:   Pid ! {self(), {print, undef}},
    receive
      {Pid, Msg} -> io:format(Msg)
    after 3000 ->
      timeout
    end.
  
  test() ->
  
negative.code:   [] = list(E),
    ok.
  
  unknown() ->
    io:format("?~n").
  
  prompt() ->
    "*".
  
  chomp(String) ->
    re:replace(String, "(^\\s+)|(\\s+$)", "", [global, {return,list}]).
  
  getnum(String) ->
    try erlang:list_to_integer(String) catch error:_Ex -> 0 end.
  
  numValid(E, Num) ->
    (Num > 0) and (Num =< lineCount(E)).
  
  setLineNum(Pid, Num) ->
    Pid ! {self(), {setLineNumber, Num}},
    receive
      {Pid, Msg} -> Msg
    after 3000 -> timeout
    end.
  
  getcmd(E) ->
    L = chomp(io:get_line(prompt())),
    case L of
      "q" -> {quit, E};
      "a" -> append(E),
               getcmd(E);
      ",p" -> printall(E),
                getcmd(E);
      "p" -> print(E),
               getcmd(E);
      _ -> Num = getnum(L),
           NumValid = numValid(E, Num),
           if NumValid ->
                setLineNum(E, Num),
                getcmd(E);
              true ->
                unknown(),
                getcmd(E)
           end
    end.
  
  run() ->
  