anchor.diff:  server(default) ->
       server(lfe_env:new());
   server(Env) ->
  -    process_flag(trap_exit, true),		%Must trap exists
  +    process_flag(trap_exit, true),              %Must trap exists
       io:fwrite("LFE Shell V~s (abort with ^G)\n",
                 [erlang:system_info(version)]),
       %% Create a default base env of predefined shell variables with
       %% default nil bindings and basic shell macros.
       St = new_state("lfe", [], Env),
  -    Eval = start_eval(St),
  -    server_loop(Eval, St).			%Run the loop
  +    Eval = start_eval(St),                      %Start an evaluator
  +    server_loop(Eval, St).                      %Run the loop
   
   server_loop(Eval0, St0) ->
       %% Read the form
       Prompt = prompt(),
       {Ret,Eval1} = read_expression(Prompt, Eval0, St0),
       case Ret of
  -	{ok,Form} ->
  -	    {Eval2,St1} = shell_eval(Form, Eval1, St0),
  -	    server_loop(Eval2, St1);
  -	{error,E} ->
  -	    list_errors([E]),
  -	    server_loop(Eval1, St0)
  -    end.
  +        {ok,Form} ->
  +            {Eval2,St1} = shell_eval(Form, Eval1, St0),
  +            server_loop(Eval2, St1);
  +        {error,E} ->
  +            list_errors([E]),
  +            server_loop(Eval1, St0)
  +    end.
  +
  +%% shell_eval(From, Evaluator, State) -> {Evaluator,State}.
  +%%  Evaluate one shell expression. The evaluator may crash in which
  +%%  case we restart it and return the pid of the new evaluator.
   
   shell_eval(Form, Eval0, St0) ->
       Eval0 ! {eval_expr,self(),Form},
       receive
  -	{eval_value,Eval0,_Value,St1} ->
  -	    server_loop(Eval0, St1);
  -	{eval_exit,Eval0,Class,Reason} ->
  -	    receive {'EXIT',Eval0,normal} -> ok end,
  -	    report_exception(Class, Reason),
  -	    Eval1 = start_eval(St0),
  -	    server_loop(Eval1, St0);
  -	{'EXIT',Eval0,Reason} ->
  -	    report_exception(error, Reason),
  -	    Eval1 = start_eval(St0),
  -	    server_loop(Eval1, St0)
  +        {eval_value,Eval0,_Value,St1} ->
  +            %% We actually don't use the returned value here.
  +            {Eval0,St1};
  +        {eval_error,Eval0,Class} ->
  +            %% Eval errored out, get the exit signal.
  +            receive {'EXIT',Eval0,{Reason,Stk}} -> ok end,
  +            report_exception(Class, Reason, Stk),
  +            Eval1 = start_eval(St0),
  +            {Eval1,St0};
  +        {'EXIT',Eval0,Error} ->
  +            %% Eval exited or was killed
  +            report_exception(error, Error, []),
  +            Eval1 = start_eval(St0),
  +            {Eval1,St0}
       end.
   
   %% prompt() -> Prompt.
  
positive.code: 
  read_expression(Prompt, Eval, St) ->
      Read = fun () ->
  		   %% Ret = lfe_io:read(Prompt),
  		   io:put_chars(Prompt),
  		   Ret = lfe_io:read(),
  		   exit(Ret)
  	   end,
      Rdr = spawn_link(Read),
      read_expression_1(Rdr, Eval, St).
  
  read_expression_1(Rdr, Eval, St) ->
      receive
  	{'EXIT',Rdr,Ret} ->
  	    {Ret,Eval};
  	{'EXIT',Eval,{Reason,Stk}} ->
  	    report_exception(error, {Reason,Stk}),
  	    read_expression_1(Rdr, start_eval(St), St);
  	{'EXIT',Eval,Reason} ->
  	    report_exception(error, {Reason,[]}),
  	    read_expression_1(Rdr, start_eval(St), St)
      end.
  
  %% new_state(ScriptName, Args [,Env]) -> State.
  
negative.code: 
  start_eval(St) ->
      Self = self(),
      spawn_link(fun () -> eval_init(Self, St) end).
  
  eval_init(Shell, St) ->
      eval_loop(Shell, St).
  
  eval_loop(Shell, St0) ->
      receive
          {eval_expr,Shell,Form} ->
              St1 = eval_form(Form, Shell, St0),
              eval_loop(Shell, St1)
      end.
  
  %% eval_form(Form, ShellPid, State) -> State.
  