anchor.diff:  	false -> "> "
       end.
   
  -%% eval_form(Form, EvalEnv, BaseEnv) -> {Value,Env}.
  -
  -eval_form(Form, Env, Benv) ->
  -    eval_exp_form(lfe_macro:expand_expr_all(Form, Env), Env, Benv).
  -
  -eval_exp_form([set,Pat,Expr], Env0, Benv) ->
  +%% eval_form(Form, State) -> {Value,State}.
  +
  +eval_form(Form, #state{env=Ee}=St) ->
  +    eval_exp_form(lfe_macro:expand_expr_all(Form, Ee), St).
  +
  +eval_exp_form([set,Pat,Expr], #state{env=Ee}=St0) ->
       %% Special case to lint pattern.
  -    case lfe_lint:pattern(Pat, Env0) of
  +    case lfe_lint:pattern(Pat, Ee) of
   	{ok,Ws} -> list_warnings(Ws);
   	{error,Es,Ws} ->
   	    list_errors(Es),
   	    list_warnings(Ws)
       end,
  -    {yes,Value,Env1} = set([Pat,Expr], Env0, Benv),
  -    {Value,Env1};
  -eval_exp_form(Eform, Env0, Benv) ->
  -    case eval_internal(Eform, Env0, Benv) of
  -	{yes,Value,Env1} -> {Value,Env1};
  +    {yes,Value,St1} = set([Pat,Expr], St0),
  +    {Value,St1};
  +eval_exp_form(Eform, St0) ->
  +    case eval_internal(Eform, St0) of
  +	{yes,Value,St1} -> {Value,St1};
   	no ->
   	    %% Normal evaluation of form.
  -	    {lfe_eval:expr(Eform, Env0),Env0}
  +	    {lfe_eval:expr(Eform, St0#state.env),St0}
       end.
   
   list_errors(Es) ->
  
positive.code: 	error -> Def
      end.
  
  %% (defsyntax safe_fetch
  %%   ((key d def)
  %%    (case (find key d)
  %%      ((tuple 'ok val) val)
  %%      ('error def))))
  
negative.code: server(_) ->
      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.
      Base0 = add_shell_macros(lfe_env:new()),
      Base1 = add_shell_vars(Base0),
      St = #state{env=Base1,base=Base1},
      server_loop(St).
  
  server_loop(St0) ->
      StX = try
  	      %% Read the form
  	      Prompt = prompt(),
  	      io:put_chars(Prompt),
  	      Form = lfe_io:read(),
  	      Ee1 = update_vbinding('-', Form, St0#state.env),
  	      %% Macro expand and evaluate it.
  	      {Value,St1} = eval_form(Form, St0#state{env=Ee1}),
  	      %% Print the result, but only to depth 30.
  	      VS = lfe_io:prettyprint1(Value, 30),
  	      io:requests([{put_chars,VS},nl]),
  	      %% Update bindings.
  	      Ee2 = update_shell_vars(Form, Value, St1#state.env),
  	      %% lfe_io:prettyprint({Env1,Env2}), io:nl(),
  	      St1#state{env=Ee2}
  	  catch
  	      %% Very naive error handling, just catch, report and
  	      %% ignore whole caboodle.
  	      Class:Error ->
  		  %% Use LFE's simplified version of erlang shell's error
  		  %% reporting but which LFE prettyprints data.
  		  Stk = erlang:get_stacktrace(),
  		  Sf = fun ({M,_F,_A}) ->	%Pre R15
  			       %% Don't want to see these in stacktrace.
  			       (M == lfe_eval) or (M == lfe_shell)
  