anchor.diff:  
   %% lc_tq(Line, Exp, [Qualifier], Mc, State) -> {LetRec,[PreExp],State}.
   %%  This TQ from Simon PJ pp 127-138.  
  -%%  This gets a bit messy as we must transform all directly here.  We
  -%%  recognise guard tests and try to fold them together and join to a
  -%%  preceding generators, this should give us better and more compact
  -%%  code.
  -
  -lc_tq(Line, E, [{generate,Lg,P,G}|Qs0], Mc, St0) ->
  -    {Gs,Qs1} =  splitwith(fun is_guard_test/1, Qs0),
  +
  +lc_tq(Line, E, [#igen{anno=GAnno,acc_pat=AccPat,acc_guard=AccGuard,
  +                      skip_pat=SkipPat,tail=Tail,tail_pat=TailPat,
  +                      arg={Pre,Arg}}|Qs], Mc, St0) ->
       {Name,St1} = new_fun_name("lc", St0),
  -    {Head,St2} = new_var(St1),
  -    {Tname,St3} = new_var_name(St2),
  -    LA = lineno_anno(Line, St3),
  -    CGAnno = #a{anno=[list_comprehension|LA]},
  -    LAnno = #a{anno=LA},
  -    Tail = #c_var{anno=LA,name=Tname},
  -    {Arg,St4} = new_var(St3),
  -    {Nc,[],St5} = expr({call,Lg,{atom,Lg,Name},[{var,Lg,Tname}]}, St4),
  -    {Guardc,St6} = lc_guard_tests(Gs, St5),	%These are always flat!
  -    {Lc,Lps,St7} = lc_tq(Line, E, Qs1, Nc, St6),
  -    {Pc,St8} = list_gen_pattern(P, Line, St7),
  -    {Gc,Gps,St9} = safe(G, St8),		%Will be a function argument!
  -    Fc = function_clause([Arg], LA, {Name,1}),
  -
  -    %% Avoid constructing a default clause if the list comprehension
  -    %% only has a variable as generator and there are no guard
  -    %% tests. In other words, if the comprehension is equivalent to
  -    %% lists:map/2.
  -    Cs0 = case {Guardc, Pc} of
  -	      {[], #c_var{}} ->
  -		  [#iclause{anno=LAnno,
  -			    pats=[#c_literal{anno=LA,val=[]}],guard=[],
  -			    body=[Mc]}];
  -	      _ ->
  -		  [#iclause{anno=#a{anno=[compiler_generated|LA]},
  -			    pats=[ann_c_cons(LA, Head, Tail)],
  -			    guard=[],
  -			    body=[Nc]},
  -		   #iclause{anno=LAnno,
  -			    pats=[#c_literal{anno=LA,val=[]}],guard=[],
  -			    body=[Mc]}]
  -	  end,
  -    Cs = case Pc of
  -	     nomatch -> Cs0;
  -	     _ ->
  -		 [#iclause{anno=LAnno,
  -			   pats=[ann_c_cons(LA, Pc, Tail)],
  -			   guard=Guardc,
  -			   body=Lps ++ [Lc]}|Cs0]
  -	 end,
  -    Fun = #ifun{anno=LAnno,id=[],vars=[Arg],clauses=Cs,fc=Fc},
  -    {#iletrec{anno=CGAnno,defs=[{{Name,1},Fun}],
  -	      body=Gps ++ [#iapply{anno=LAnno,
  -				   op=#c_var{anno=LA,name={Name,1}},
  -				   args=[Gc]}]},
  -     [],St9};
  -lc_tq(Line, E, [{b_generate,Lg,P,G}|Qs0], Mc, St0) ->
  -    {Gs,Qs1} =  splitwith(fun is_guard_test/1, Qs0),
  -    {Name,St1} = new_fun_name("blc", St0),
       LA = lineno_anno(Line, St1),
       LAnno = #a{anno=LA},
  -    CGAnno = #a{anno=[list_comprehension|LA]},
  -    HeadBinPattern = pattern(P, St1),
  -    #c_binary{segments=Ps0} = HeadBinPattern,
  -    {Ps,Tail,St2} = append_tail_segment(Ps0, St1),
  -    {EPs,St3} = emasculate_segments(Ps, St2),
  -    Pattern = HeadBinPattern#c_binary{segments=Ps},
  -    EPattern = HeadBinPattern#c_binary{segments=EPs},
  -    {Arg,St4} = new_var(St3),
  -    {Guardc,St5} = lc_guard_tests(Gs, St4),	%These are always flat!
  -    Tname = Tail#c_var.name,
  -    {Nc,[],St6} = expr({call,Lg,{atom,Lg,Name},[{var,Lg,Tname}]}, St5),
  -    {Bc,Bps,St7} = lc_tq(Line, E, Qs1, Nc, St6),
  -    {Gc,Gps,St10} = safe(G, St7),		%Will be a function argument!
  -    Fc = function_clause([Arg], LA, {Name,1}),
  -    {TailSegList,_,St} = append_tail_segment([], St10),
  -    Cs = [#iclause{anno=#a{anno=[compiler_generated|LA]},
  -		   pats=[Pattern],
  -		   guard=Guardc,
  -		   body=Bps ++ [Bc]},
  -	  #iclause{anno=#a{anno=[compiler_generated|LA]},
  -		   pats=[EPattern],
  -		   guard=[],
  -		   body=[#iapply{anno=LAnno,
  -				 op=#c_var{anno=LA,name={Name,1}},
  -				 args=[Tail]}]},
  -	  #iclause{anno=LAnno,
  -		   pats=[#c_binary{anno=LA,segments=TailSegList}],guard=[],
  -		   body=[Mc]}],
  -    Fun = #ifun{anno=LAnno,id=[],vars=[Arg],clauses=Cs,fc=Fc},
  -    {#iletrec{anno=CGAnno,defs=[{{Name,1},Fun}],
  -	      body=Gps ++ [#iapply{anno=LAnno,
  -				   op=#c_var{anno=LA,name={Name,1}},
  -				   args=[Gc]}]},
  -     [],St};
  -lc_tq(Line, E, [Fil0|Qs0], Mc, St0) ->
  -    %% Special case sequences guard tests.
  -    LA = lineno_anno(element(2, Fil0), St0),
  -    LAnno = #a{anno=LA},
  -    CGAnno = #a{anno=[list_comprehension|LA]},
  -    case is_guard_test(Fil0) of
  -	true ->
  -	    {Gs0,Qs1} = splitwith(fun is_guard_test/1, Qs0),
  -	    {Lc,Lps,St1} = lc_tq(Line, E, Qs1, Mc, St0),
  -	    {Gs,St2} = lc_guard_tests([Fil0|Gs0], St1), %These are always flat!
  -	    {#icase{anno=CGAnno,
  -		    args=[],
  -		    clauses=[#iclause{anno=LAnno,pats=[],
  -				      guard=Gs,body=Lps ++ [Lc]}],
  -		    fc=#iclause{anno=LAnno#a{anno=[compiler_generated|LA]},
  -				pats=[],guard=[],body=[Mc]}},
  -	     [],St2};
  -	false ->
  -	    {Lc,Lps,St1} = lc_tq(Line, E, Qs0, Mc, St0),
  -	    {Fpat,St2} = new_var(St1),
  -	    Fc = fail_clause([Fpat], LA,
  -			     c_tuple([#c_literal{val=case_clause},Fpat])),
  -	    %% Do a novars little optimisation here.
  -	    {Filc,Fps,St3} = novars(Fil0, St2),
  -	    {#icase{anno=CGAnno,
  -		    args=[Filc],
  -		    clauses=[#iclause{anno=LAnno,
  -				      pats=[#c_literal{anno=LA,val=true}],
  -				      guard=[],
  -				      body=Lps ++ [Lc]},
  -			     #iclause{anno=LAnno#a{anno=[compiler_generated|LA]},
  -				      pats=[#c_literal{anno=LA,val=false}],
  -				      guard=[],
  -				      body=[Mc]}],
  -		    fc=Fc},
  -	     Fps,St3}
  -    end;
  +    F = #c_var{anno=LA,name={Name,1}},
  +    Nc = #iapply{anno=GAnno,op=F,args=[Tail]},
  +    {Var,St2} = new_var(St1),
  +    Fc = function_clause([Var], LA, {Name,1}),
  +    TailClause = #iclause{anno=LAnno,pats=[TailPat],guard=[],body=[Mc]},
  +    Cs0 = case {AccPat,AccGuard} of
  +              {SkipPat,[]} ->
  +                  %% Skip and accumulator patterns are the same and there is
  +                  %% no guard, no need to generate a skip clause.
  +                  [TailClause];
  +              _ ->
  +                  [#iclause{anno=#a{anno=[compiler_generated|LA]},
  +                            pats=[SkipPat],guard=[],body=[Nc]},
  +                   TailClause]
  +          end,
  +    {Cs,St4} = case AccPat of
  +                   nomatch ->
  +                       %% The accumulator pattern never matches, no need
  +                       %% for an accumulator clause.
  +                       {Cs0,St2};
  +                   _ ->
  +                       {Lc,Lps,St3} = lc_tq(Line, E, Qs, Nc, St2),
  +                       {[#iclause{anno=LAnno,pats=[AccPat],guard=AccGuard,
  +                                  body=Lps ++ [Lc]}|Cs0],
  +                        St3}
  +               end,
  +    Fun = #ifun{anno=LAnno,id=[],vars=[Var],clauses=Cs,fc=Fc},
  +    {#iletrec{anno=LAnno#a{anno=[list_comprehension|LA]},defs=[{{Name,1},Fun}],
  +              body=Pre ++ [#iapply{anno=LAnno,op=F,args=[Arg]}]},
  +     [],St4};
  +lc_tq(Line, E, [#ifilter{}=Filter|Qs], Mc, St) ->
  +    filter_tq(Line, E, Filter, Mc, St, Qs, fun lc_tq/5);
   lc_tq(Line, E0, [], Mc0, St0) ->
       {H1,Hps,St1} = safe(E0, St0),
       {T1,Tps,St} = force_safe(Mc0, St1),
  
positive.code: -type ireceive2() :: #ireceive2{}.
  -type iset()      :: #iset{}.
  -type itry()      :: #itry{}.
  
  -type i() :: iapply()   | ibinary()   | icall()     | icase()  | icatch()
             | iclause()  | ifun()      | iletrec()   | imatch() | iprimop()
             | iprotect() | ireceive1() | ireceive2() | iset()   | itry().
  
  -type warning() :: {file:filename(), [{integer(), module(), term()}]}.
  
  
negative.code: 	Other when not is_atom(Other) ->
  	    {#imatch{anno=#a{anno=Lanno},pat=P2,arg=E2,fc=Fc},Eps,St4}
      end;
  expr({op,_,'++',{lc,Llc,E,Qs0},More}, St0) ->
      %% Optimise '++' here because of the list comprehension algorithm.
      %%
      %% To avoid achieving quadratic complexity if there is a chain of
  