anchor.diff:              list_errors(Es),
               list_warnings(Ws)
       end,
  -    set_1([Epat|Rest], St).
  -
  -set_1([Pat,['when'|_]=G,Exp], #state{curr=Ce0}=St) ->
  +    set_1(Epat, Rest, St).
  +
  +set_1(Pat, [['when'|_]=G,Exp], St) ->
  +    set_1(Pat, [G], Exp, St);                   %Just the guard
  +set_1(Pat, [Exp], St) ->
  +    set_1(Pat, [], Exp, St);                    %Empty body
  +set_1(_, _, _) -> erlang:error({bad_form,'set'}).
  +
  +set_1(Pat, Guard, Exp, #state{curr=Ce0}=St) ->
       Val = lfe_eval:expr(Exp, Ce0),              %Evaluate expression
  -    case lfe_eval:match_when(Pat, Val, [G], Ce0) of
  +    case lfe_eval:match_when(Pat, Val, Guard, Ce0) of
           {yes,_,Bs} ->
               Ce1 = foldl(fun ({N,V}, E) -> add_vbinding(N, V, E) end,
                           Ce0, Bs),
               {Val,St#state{curr=Ce1}};
           no -> erlang:error({badmatch,Val})
  -    end;
  -set_1([Pat,Exp], #state{curr=Ce0}=St) ->
  -    Val = lfe_eval:expr(Exp, Ce0),              %Evaluate expression
  -    case lfe_eval:match(Pat, Val, Ce0) of
  -        {yes,Bs} ->
  -            Ce1 = foldl(fun ({N,V}, E) -> add_vbinding(N, V, E) end,
  -                        Ce0, Bs),
  -            {Val,St#state{curr=Ce1}};
  -        no -> erlang:error({badmatch,Val})
  -    end;
  -set_1(_, _) -> erlang:error({bad_form,'set'}).
  +    end.
   
   %% unslurp(State) -> {ok,State}.
   %% slurp(File, State) -> {{ok,Mod},State}.
  -%%  Load in a file making all functions available. The module is
  -%%  loaded in an empty environment and that environment is finally
  -%%  added to the standard current environment. We could not use the
  -%%  compiler here as we need the macro environment.
  +%%  Load in a file making all functions available. We call the
  +%%  compiler directly and only add defined functions, macros are
  +%%  lost. Any exported macros will be available in the
  +%%  LFE-EXPAND-USER-MACRO/2 function.
   
   -record(slurp, {mod,imps=[]}).                  %For slurping
   
  
positive.code:     end.
  
  slurp_file(Name) ->
      %% Parse, expand macros and lint file.
      case lfe_io:parse_file(Name) of
          {ok,Fs0} ->
              case lfe_macro:expand_forms(Fs0, lfe_env:new()) of
                  {ok,Fs1,Fenv,_} ->
                      case lfe_comp:group_modules(Fs1) of
                          [{ok,_,Fs2,_}] ->       %Only single module
                              case lfe_lint:module(Fs2) of
                                  {ok,_,Ws} -> {ok,Fs2,Fenv,Ws};
                                  {error,_,_}=Error -> Error
                              end;
                          _ -> {error,[{0,lfe_lint,{bad_mdef,multi}}],[]}
                      end;
                  {error,_,_}=Error -> Error
              end;
          {error,E} -> {error,[E],[]}
      end.
  
  slurp_errors(File, Es) -> slurp_ews(File, "~s:~w: ~s\n", Es).
  
negative.code:             {error,St1}
      end.
  
  slurp_1(Name, Ce0) ->
      case slurp_file(Name) of
  	{ok,Mod,Fs,Ws} ->
  	    slurp_warnings(Name, Ws),
  	    Sl0 = #slurp{mod=Mod,imps=[]},
  	    {Fbs,Sl1} = lfe_lib:proc_forms(fun collect_form/3, Fs, Sl0),
              %% Add imports to environment.
              Ce1 = foldl(fun ({M,Is}, Env) ->
  				foldl(fun ({{F,A},R}, E) ->
  					      add_ibinding(M, F, A, R, E)
  				      end, Env, Is)
  			end, Ce0, Sl1#slurp.imps),
  	    %% Add functions to environment.
  	    Ce2 = foldl(fun ({N,Ar,Def}, Env) ->
  				lfe_eval:add_dynamic_func(N, Ar, Def, Env)
  			end, Ce1, Fbs),
  	    {ok,Mod,Ce2};
          {error,Es,Ws} ->
              slurp_errors(Name, Es),
              slurp_warnings(Name, Ws),
  