anchor.diff:  %% Basically illegal syntax which maybe generated by internal tools.
   from_pat({call,_,{atom,_,F},As}, Vt0, St0) ->
       %% This will never occur in real code but for macro expansions.
  -    {Las,Eqt,Vt1,St1} = from_pat_list(As, Vt0, St0),
  +    {Las,Eqt,Vt1,St1} = from_pats(As, Vt0, St0),
       {[F|Las],Eqt,Vt1,St1}.
   
  -from_pat_list([P|Ps], Vt0, St0) ->
  +from_pats([P|Ps], Vt0, St0) ->
       {Lp,Eqt,Vt1,St1} = from_pat(P, Vt0, St0),
  -    {Lps,Eqts,Vt2,St2} = from_pat_list(Ps, Vt1, St1),
  +    {Lps,Eqts,Vt2,St2} = from_pats(Ps, Vt1, St1),
       {[Lp|Lps],Eqt++Eqts,Vt2,St2};
  -from_pat_list([], Vt, St) -> {[],[],Vt,St}.
  +from_pats([], Vt, St) -> {[],[],Vt,St}.
   
   from_pat_map_assocs([{map_field_exact,_,Key,Val}|As], Vt0, St0) ->
       {Lk,Eqt1,Vt1,St1} = from_pat(Key, Vt0, St0),
  
positive.code:     {[Et|Eqs],Vt1,St2};
  to_lc_quals([], _, Vt, St) -> {[],Vt,St}.
  
  %% new_to_var(State) -> {VarName, State}.
  new_to_var(#to{vc=C}=St) ->
      V = list_to_atom(lists:concat(["___",C,"___"])),
      {V,St#to{vc=C+1}}.
  
  %% to_pat(Pattern, LineNumber, VarTable, State) -> {Pattern,VarTable,State}.
  
  to_pat([], L, Vt, St) -> {{nil,L},Vt,St};
  to_pat(I, L, Vt, St) when is_integer(I) -> {{integer,L,I},Vt,St};
  to_pat(F, L, Vt, St) when is_float(F) -> {{float,L,F},Vt,St};
  to_pat(V, L, Vt, St) when is_atom(V) ->         %Unquoted atom
      to_pat_var(V, L, Vt, St);
  to_pat(T, L, Vt, St) when is_tuple(T) ->        %Tuple literal
      Es = to_lit_list(tuple_to_list(T), L),
      {{tuple,L,Es},Vt,St};
  to_pat(?Q(P), L, Vt, St) ->                     %Everything quoted here
      {to_lit(P, L),Vt,St};
  to_pat([cons,H,T], L, Vt0, St0) ->
      {[Eh,Et],Vt1,St1} = to_pat_list([H,T], L, Vt0, St0),
      {{cons,L,Eh,Et},Vt1,St1};
  to_pat([list|Es], L, Vt, St) ->
      Fun = fun (E, {Tail,Vt0,St0}) ->
                    {Ee,Vt1,St1} = to_pat(E, L, Vt0, St0),
                    {{cons,L,Ee,Tail},Vt1,St1}
            end,
      foldr(Fun, {{nil,L},Vt,St}, Es);
  to_pat(['list*'|Es], L, Vt, St) ->
      to_pat_list_s(fun to_pat/4, L, Vt, St, Es);
  to_pat([tuple|Es], L, Vt0, St0) ->
      {Ees,Vt1,St1} = to_pat_list(Es, L, Vt0, St0),
      {{tuple,L,Ees},Vt1,St1};
  to_pat([binary|Segs], L, Vt0, St0) ->
      {Esegs,Vt1,St1} = to_pat_bitsegs(Segs, L, Vt0, St0),
      {{bin,L,Esegs},Vt1,St1};
  to_pat([map|Pairs], L, Vt0, St0) ->
      {As,Vt1,St1} = to_pat_map_pairs(Pairs, L, Vt0, St0),
      {{map,L,As},Vt1,St1};
  to_pat(['=',P1,P2], L, Vt0, St0) ->        %Alias
      {Ep1,Vt1,St1} = to_pat(P1, L, Vt0, St0),
      {Ep2,Vt2,St2} = to_pat(P2, L, Vt1, St1),
      {{match,L,Ep1,Ep2},Vt2,St2}.
  
  to_pat_list(Ps, L, Vt, St) ->
      Fun = fun (P, Vt0, St0) -> to_pat(P, L, Vt0, St0) end,
      mapfoldl2(Fun, Vt, St, Ps).
  
  to_pat_var(V, L, Vt, St0) ->
      case orddict:is_key(V, Vt) of
          true ->
              {V1,St1} = new_to_var(St0),
              {{var,L,V1},orddict:store(V, V1, Vt),St1};
          false ->
              {{var,L,V},orddict:store(V, V, Vt),St0}
      end.
  
  to_pat_map_pairs([K,V|Ps], L, Vt0, St0) ->
      {Ek,Vt1,St1} = to_pat(K, L, Vt0, St0),
      {Ev,Vt2,St2} = to_pat(V, L, Vt1, St1),
      {Eps,Vt3,St3} = to_pat_map_pairs(Ps, L, Vt2, St2),
      {[{map_field_exact,L,Ek,Ev}|Eps],Vt3,St3};
  to_pat_map_pairs([], _, Vt, St) -> {[],Vt,St}.
  
  %% to_pat_bitsegs(Segs, LineNumber, VarTable, State) -> {Segs,State}.
  %% This gives a verbose value, but it is correct.
  
  to_pat_bitsegs(Ss, L, Vt, St) ->
      Fun = fun (S, Vt0, St0) -> to_pat_bitseg(S, L, Vt0, St0) end,
      mapfoldl2(Fun, Vt, St, Ss).
  
  to_pat_bitseg([Val|Specs]=F, L, Vt, St) ->
      case is_posint_list(F) of
          true ->
              {Size,Type} = to_bitspecs([]),
              to_pat_bin_element(F, Size, Type, L, Vt, St);
          false ->
              {Size,Type} = to_bitspecs(Specs),
              to_pat_bin_element(Val, Size, Type, L, Vt, St)
      end;
  to_pat_bitseg(Val, L, Vt, St) ->
      {Size,Type} = to_bitspecs([]),
      to_pat_bin_element(Val, Size, Type, L, Vt, St).
  
  to_pat_bin_element(Val, Size, {Type,Unit,Sign,End}, L, Vt0, St0) ->
      {Eval,Vt1,St1} = to_pat(Val, L, Vt0, St0),
      {Esiz,Vt2,St2} = to_pat_bin_size(Size, L, Vt1, St1),
      {{bin_element,L,Eval,Esiz,[Type,to_bin_unit(Unit),Sign,End]},Vt2,St2}.
  
  to_pat_bin_size(default, _, Vt, St) -> {default,Vt,St};
  to_pat_bin_size(undefined, _, Vt, St) -> {default,Vt,St};
  to_pat_bin_size(Size, L, Vt, St) -> to_pat(Size, L, Vt, St).
  
  to_lit([], L) -> {nil,L};
  to_lit(I, L) when is_integer(I) -> {integer,L,I};
  to_lit(F, L) when is_float(F) -> {float,L,F};
  to_lit(V, L) when is_atom(V) -> {atom,L,V};    %Quoted atom here!
  to_lit([H|T], L) ->
      {cons,L,to_lit(H, L),to_lit(T, L)};
  to_lit(T, L) when is_tuple(T) ->
      {tuple,L,to_lit_list(tuple_to_list(T), L)}.
  
  to_lit_list(Ps, L) -> [ to_lit(P, L) || P <- Ps ].
  
  
  is_posint_list([I|Is]) when is_integer(I), I >= 0 ->
      is_posint_list(Is);
  
negative.code: 
  -module(lfe_trans).
  
  -export([from_expr/1,from_expr/2,from_body/1,from_body/2,from_lit/1]).
  -export([to_expr/2,to_exprs/2,to_lit/2]).
  
  -import(lists, [map/2,foldl/3,mapfoldl/3,foldr/3,splitwith/2]).
  
  
  %% We do a lot of quoting!
  -define(Q(E), [quote,E]).
  -define(BQ(E), [backquote,E]).
  -define(C(E), [comma,E]).
  -define(C_A(E), ['comma-at',E]).
  
  %% Define IS_MAP/1 macro for is_map/1 bif.
  -ifdef(HAS_MAPS).
  -define(IS_MAP(T), is_map(T)).
  -else.
  -define(IS_MAP(T), false).
  -endif.
  
  -record(from, {vc=0                             %Variable counter
                }).
  