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:             {error,St1}
      end.
  
  slurp_1(Name, Ce) ->
      case slurp_file(Name) of                    %Parse, expand and lint file
          {ok,Fs,Fenv0,Ws} ->
              slurp_warnings(Name, Ws),
              Sl0 = #slurp{mod='-no-mod-',imps=[]},
              {Fbs,Sl1} = lfe_lib:proc_forms(fun collect_form/3, Fs, Sl0),
              %% Add imports to environment.
              Fenv1 = foldl(fun ({M,Is}, Env) ->
                                    foldl(fun ({{F,A},R}, E) ->
                                                  add_ibinding(M, F, A, R, E)
                                          end, Env, Is)
                            end, Fenv0, Sl1#slurp.imps),
              %% Get a new environment with all functions defined.
              Fenv2 = lfe_eval:make_letrec_env(Fbs, Fenv1),
              {ok,Sl1#slurp.mod,add_env(Fenv2, Ce)};
          {error,Es,Ws} ->
              slurp_errors(Name, Es),
              slurp_warnings(Name, Ws),
  
negative.code:     end.
  
  slurp_file(Name) ->
      case lfe_comp:file(Name, [binary,to_lint,return]) of
  	{ok,[{ok,Mod,Fs,Mws}|_],Ws} ->		%Only do first module
  	    {ok,Mod,Fs,Ws ++ Mws};
  	{error,_,_}=Error ->
  	    Error
      end.
  
  slurp_errors(File, Es) -> slurp_ews(File, "~s:~w: ~s\n", Es).
  