anchor.diff:      is_integer_list(Is);
   is_integer_list([]) -> true;
   is_integer_list(_) -> false.
  +
  +%% var_name(Var, Vars) -> Var.
  +%% new_var_name(Var, Vars) -> {Var,Vars}.
  +%%  New_var_name is used in patterns and always generates a new unused
  +%%  var name. This so we don't have to know all vars which we may be
  +%%  shadowing.
  +
  +var_name(V, Vs) ->
  +    case find(V, Vs) of
  +	{ok,V1} -> V1;
  +	error -> V
  +    end.
  +
  +new_var_name(Base, Vs) ->
  +    case find(Base, Vs) of
  +	{ok,V} ->
  +	    V1 = list_to_atom(lists:concat([V,'_'])),
  +	    {V1,store(Base, V1, Vs)};
  +	error ->
  +	    V1 = list_to_atom(lists:concat(['_',Base,'_'])),
  +	    {V1,store(Base, V1, Vs)}
  +    end.
  
positive.code: 	orelse erl_internal:list_op(Op, Ar)
  	orelse erl_internal:send_op(Op, Ar).
  
  to_body(Es, L) -> [ to_expr(E, L) || E <- Es ].
  
  to_expr_list(Es, L) -> [ to_expr(E, L) || E <- Es ].
  
  to_list_s([E], L, F) -> F(E, L);
  to_list_s([E|Es], L, F) ->
      {cons,L,F(E, L),to_list_s(Es, L, F)};
  to_list_s([], L, _) -> {nil,L}.
  
  %% to_block(Expressions, LineNumber) -> Block.
  %% Don't generate {block,...} if only one expression, though
  %% semantically the same some tools can't handle it (qlc_pt).
  
  to_block(Es0, L) ->
      case to_expr_list(Es0, L) of
  	[E] -> E;				%No need to wrap
  	Es1 -> {block,L,Es1}			%Must wrap
      end.
  
  %% to_let_bindings(Bindings, LineNumber) -> Block.
  
  to_let_bindings(Lbs, L) ->
      map(fun ([P,V]) -> {match,L,to_pat(P, L),to_expr(V, L)} end, Lbs).
  
  %% to_icrt_cls(Clauses, LineNumber) -> Clauses.
  %% to_icrt_cl(Clause, LineNumber) -> Clause.
  %%  If/case/receive/try clauses.
  
  to_icrt_cls(Cls, L) ->
      lists:map(fun (Cl) -> to_icrt_cl(Cl, L) end, Cls).
  
  to_icrt_cl([P,['when'|G]|B], L) ->
      {clause,L,[to_pat(P, L)],to_body(G, L),to_body(B, L)};
  to_icrt_cl([P|B], L) ->
      {clause,L,[to_pat(P, L)],[],to_body(B, L)}.
  
  %% to_fun_cls(Clauses, LineNumber) -> Clauses.
  %% to_fun_cl(Clause, LineNumber) -> Clause.
  %%  Function clauses.
  
  to_fun_cls(Cls, L) ->
      lists:map(fun (Cl) -> to_fun_cl(Cl, L) end, Cls).
  
  to_fun_cl([As,['when'|G]|B], L) ->
      {clause,L,to_pat_list(As, L),to_body(G, L),to_body(B, L)};
  to_fun_cl([As|B], L) ->
      {clause,L,to_pat_list(As, L),[],to_body(B, L)}.
  
  %% to_lc_quals(Qualifiers, LineNumber) -> Qualifiers
  
  to_lc_quals([['<-',P,E]|Qs], L) ->
      [{generate,L,to_pat(P, L),to_expr(E, L)}|to_lc_quals(Qs, L)];
  to_lc_quals([['<-',P,['when'|G],E]|Qs], L) ->
      to_lc_quals([['<-',P,E]|G ++ Qs], L);	%Move guards to tests
  to_lc_quals([T|Qs], L) ->
      [to_expr(T, L)|to_lc_quals(Qs, L)];
  to_lc_quals([], _) -> [].
  
  %% to_bitsegs(Segs, LineNumber) -> Segs.
  %% This gives a verbose value, but it is correct.
  
  to_bitsegs(Ss, L) -> map(fun (S) -> to_bitseg(S, L) end, Ss).
  
  to_bitseg([Val|Specs]=F, L) ->
      case is_integer_list(F) of
  	true ->
  	    {Size,Type} = to_bitspecs([]),
  	    to_bin_element({string,L,F},to_expr(Size, L), Type, L);
  	false ->
  	    {Size,Type} = to_bitspecs(Specs),
  	    to_bin_element(to_expr(Val, L),to_expr(Size, L), Type, L)
      end;
  to_bitseg(Val, L) ->
      {Size,Type} = to_bitspecs([]),
      to_bin_element(to_expr(Val, L),to_expr(Size, L), Type, L).
  
  to_bin_element(Val, Size, {Type,Unit,Sign,End}, L) ->
      {bin_element,L,Val,Size,[Type,{unit,Unit},Sign,End]}.
  
negative.code: from_pat_list(Ps) -> [ from_pat(P) || P <- Ps ].
  
  %% to_vanilla(Sexp, LineNumber) -> AST.
  %%  Convert an LFE sexpr to an vanilla AST. The only difficulty is the
  %%  handling of variables in (let ...). We assume that all macros have
  %%  been expanded EXCEPT lc which we need for QLC's.
  
  to_vanilla(S, L) ->
      %% Be very LOUD for the time being.
      case catch {ok,to_expr(S, L, new())} of
  	{ok,AST} -> AST;
  	Other ->
  	    io:format("BOOM: ~p\n", [Other]),
  	    error(Other)
      end.
  
  %% to_expr(Expr, LineNumber, Vars) -> Expr.
  
  to_expr([], L, _) -> {nil,L};
  to_expr(I, L, _) when is_integer(I) -> {integer,L,I};
  to_expr(F, L, _) when is_float(F) -> {float,L,F};
  to_expr(V, L, Vs) when is_atom(V) ->		%Unquoted atom
      {var,L,var_name(V, Vs)};
  to_expr(T, L, Vs) when is_tuple(T) ->
      {tuple,L,to_expr_list(tuple_to_list(T), L, Vs)};
  to_expr(?Q(V), L, _) -> to_lit(V, L);
  to_expr([cons,H,T], L, Vs) ->
      {cons,L,to_expr(H, L, Vs),to_expr(T, L, Vs)};
  to_expr([car,E], L, Vs) -> {call,L,{atom,L,hd},[to_expr(E, L, Vs)]};
  to_expr([cdr,E], L, Vs) -> {call,L,{atom,L,tl},[to_expr(E, L, Vs)]};
  to_expr([list|Es], L, Vs) ->
      foldr(fun (E, T) -> {cons,L,to_expr(E, L, Vs),T} end, {nil,L}, Es);
  to_expr([tuple|Es], L, Vs) ->
      {tuple,L,to_expr_list(Es, L, Vs)};
  to_expr([binary|Segs], L, Vs) ->
      {bin,L,to_bitsegs(Segs, L, Vs)};
  %% Core closure special forms.
  to_expr([lambda,As|B], L, Vs) ->
      {'fun',L,{clauses,[to_fun_cl([As|B], L, Vs)]}};
  to_expr(['match-lambda'|Cls], L, Vs) ->
      {'fun',L,{clauses,to_fun_cls(Cls, L, Vs)}};
  to_expr(['fun',F,A], L, _) -> {'fun',L,{function,F,A}};
  to_expr(['fun',M,F,A], L, _) -> {'fun',L,{function,M,F,A}};
  to_expr(['let',Lbs0|B0], L, Vs0) ->
      {Lbs1,Vs1} = to_let_bindings(Lbs0, L, Vs0),
      B1 = to_body(B0, L, Vs1),
      {block,L,Lbs1 ++ B1};
  %% Core control special forms.
  to_expr([progn|B], L, Vs) -> to_block(B, L, Vs);
  to_expr(['if',Test,True], L, Vs) ->
      to_expr(['if',Test,True,?Q(false)], L, Vs);
  to_expr(['if',Test,True,False], L, Vs) ->
      {'case',L,to_expr(Test, L, Vs),
       to_icrt_cls([[?Q(true),True],[?Q(false),False]], L, Vs)};
  to_expr(['case',E|Cls], L, Vs) ->
      {'case',L,to_expr(E, L, Vs),to_icrt_cls(Cls, L, Vs)};
  to_expr(['receive'|Cls0], L, Vs) ->
      %% Get the right receive form depending on whether there is an after.
      {Cls1,A} = splitwith(fun (['after'|_]) -> false; (_) -> true end, Cls0),
      case A of
  	[['after',T|B]] ->
  	    {'receive',L,to_icrt_cls(Cls1, L, Vs),
  	     to_expr(T, L, Vs),to_body(B, L, Vs)};
  	[] ->
  	    {'receive',L,to_icrt_cls(Cls1, L, Vs)}
      end;
  %% Special known macros.
  %% No record stuff here as they are macros which have been expanded.
  %% Only lc for QLC.
  to_expr([lc,Qs0|Es], L, Vs0) ->
      {Qs1,Vs1} = to_lc_quals(Qs0, L, Vs0),
      {lc,L,to_block(Es, L, Vs1),Qs1};
  %% General function calls.
  to_expr([call,?Q(erlang),?Q(F)|As], L, Vs) ->
      %% This is semantically the same but some tools behave differently
      %% (qlc_pt).
      case is_erl_op(F, length(As)) of
  	true -> list_to_tuple([op,L,F|to_expr_list(As, L, Vs)]);
  	false ->
  	    {call,L,{remote,{atom,L,erlang},{atom,L,F}},
  	     to_expr_list(As, L, Vs)}
      end;
  to_expr([call,M,F|As], L, Vs) ->
      {call,L,{remote,L,to_expr(M, L, Vs),to_expr(F, L, Vs)},
       to_expr_list(As, L, Vs)};
  to_expr([F|As], L, Vs) when is_atom(F) ->	%General function call
      case is_erl_op(F, length(As)) of
  	true -> list_to_tuple([op,L,F|to_expr_list(As, L, Vs)]);
  	false -> {call,L,{atom,L,F},to_expr_list(As, L, Vs)}
      end;
  to_expr(List, L, _) ->
      case is_integer_list(List) of
  	true -> {string,L,List};
  	false ->
  