anchor.diff:    [] = 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 = io:get_line("*"),
  +  L = chomp(io:get_line(prompt())),
     case L of
  -    "q\n" -> {quit, E};
  -    "a\n" -> append(E),
  +    "q" -> {quit, E};
  +    "a" -> append(E),
                getcmd(E);
  -    ",p\n" -> printall(E),
  +    ",p" -> printall(E),
                 getcmd(E);
  -    "p\n" -> print(E),
  +    "p" -> print(E),
                getcmd(E);
  -    _ -> io:format("?~n"),
  -         getcmd(E)
  +    _ -> Num = getnum(L),
  +         NumValid = numValid(E, Num),
  +         if NumValid ->
  +              setLineNum(E, Num),
  +              getcmd(E);
  +            true ->
  +              unknown(),
  +              getcmd(E)
  +         end
     end.
   
   run() ->
  
positive.code:   Pid ! {self(), {print, undef}},
    receive
      {Pid, Msg} -> io:format(Msg)
    after 3000 ->
      timeout
    end.
  
  test() ->
  
negative.code:   receive
      {From, {append, Line}} ->
        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);
  