anchor.diff:              error
       end.
   
  -slurp_errors(Errors) ->
  -    foreach(fun ({File,Es}) -> slurp_errors(File, Es) end, Errors).
  -
  -slurp_warnings(Warnings) ->
  -    foreach(fun ({File,Ws}) -> slurp_warnings(File, Ws) end, Warnings).
  -
  -slurp_errors(File, Es) -> slurp_ews(File, "~s:~w: ~s\n", Es).
  -
  -slurp_warnings(File, Es) -> slurp_ews(File, "~s:~w: Warning: ~s\n", Es).
  -
  -slurp_ews(File, Format, Ews) ->
  -    foreach(fun ({Line,Mod,Error}) ->
  -                    Cs = Mod:format_error(Error),
  -                    lfe_io:format(Format, [File,Line,Cs])
  -            end, Ews).
  -
  -collect_form(['define-module',Mod|Mdef], _, St0) ->
  -    St1 = collect_mdef(Mdef, St0),
  -    {[],St1#slurp{mod=Mod}};
  -collect_form(['extend-module'|Mdef], _, St0) ->
  -    St1 = collect_mdef(Mdef, St0),
  -    {[],St1};
  -collect_form(['eval-when-compile'|_], _, St) ->
  -    %% Can safely ignore this, everything already in environment.
  -    {[],St};
  -collect_form(['define-function',F,Def], _, St) ->
  +slurp_file(Name) ->
  +    case lfe_comp:file(Name, [binary,to_split,return]) of
  +        {ok,[{ok,Mod,Fs0,_}|_],Ws} ->           %Only do first module
  +            case lfe_macro:expand_forms(Fs0, lfe_env:new()) of
  +                {ok,Fs1,Env,_} ->
  +                    %% Flatten and trim away any eval-when-compile.
  +                    {Fs2,42} = lfe_lib:proc_forms(fun slurp_form/3, Fs1, 42),
  +                    case lfe_lint:module(Fs2) of
  +                        {ok,_,Lws} -> {ok,Mod,Fs2,Env,Ws ++ Lws};
  +                        {error,Les,Lws} ->
  +                            slurp_error_ret(Name, Les, Ws ++ Lws)
  +                    end;
  +                {error,Ees,Ews} ->
  +                    slurp_error_ret(Name, Ees, Ws ++ Ews)
  +            end;
  +        Error -> Error
  +    end.
  +
  +slurp_error_ret(Name, Es, Ws) ->
  +    {error,[],[{Name,Es}],[{Name,Ws}]}.
  +
  +slurp_form(['eval-when-compile'|_], _, D) -> {[],D};
  +slurp_form(F, L, D) -> {[{F,L}],D}.
  +
  +collect_module({['define-module',Mod|Mdef],_}, Sl0) ->
  +    Sl1 = collect_mdef(Mdef, Sl0),
  +    Sl1#slurp{mod=Mod};
  +collect_module({['extend-module'|Mdef],_}, Sl) ->
  +    collect_mdef(Mdef, Sl);
  +collect_module({['define-function',F,Def],_}, #slurp{funs=Fs}=Sl) ->
       Ar = function_arity(Def),
  -    {[{F,Ar,Def}],St}.
  +    Sl#slurp{funs=[{F,Ar,Def}|Fs]}.
   
   collect_mdef([[import|Is]|Mdef], St) ->
       collect_mdef(Mdef, collect_imps(Is, St));
  
positive.code:     Imps0 = safe_fetch(Mod, St#slurp.imps, []),
      Imps1 = foldl(Fun, Imps0, Fs),
      St#slurp{imps=store(Mod, Imps1, St#slurp.imps)}.
  
  %% run(Args, State) -> {Value,State}.
  %%  Run the shell expressions in a file. Abort on errors and only
  
negative.code: 
  %% unslurp(State) -> {ok,State}.
  %% slurp(File, State) -> {{ok,Mod},State}.
  %%  Load in a file making all the functions and macros available.
  %%  There is a bit of trickery to get hold of the compile environment
  %%  to get hold of the macros. We call the compiler directly but don't
  %%  make the LFE-EXPAND-EXPORTED-MACRO/3 function.
  
  -record(slurp, {mod,funs=[],imps=[]}).          %For slurping
  
  unslurp(St0) ->
      St1 = case St0#state.slurp of
  