anchor.diff:  %% is_simple(CoreExp) -> bool().
   %%  Test if CoreExp is simple, i.e. just constructs terms.
   
  -is_simple(#c_var{}) -> true;
  -is_simple(#c_literal{}) -> true;
  -is_simple(#c_cons{hd=H,tl=T}) ->
  -    is_simple(H) andalso is_simple(T);
  -is_simple(#c_tuple{es=Es}) -> is_simple_list(Es);
  -is_simple(#c_binary{segments=Es}) -> is_simple_bin(Es);
  -is_simple(_) -> false.
  +is_simple(Ce) ->
  +    case cerl:type(Ce) of
  +        var -> true;
  +        literal -> true;
  +        cons ->
  +            is_simple(cons_hd(Ce)) andalso is_simple(cons_tl(Ce));
  +        tuple ->
  +            is_simple_list(tuple_es(Ce));
  +        binary ->
  +            is_simple_bin(binary_segments(Ce));
  +        _ -> false
  +    end.
   
   is_simple_list(Es) -> all(fun is_simple/1, Es).
   
   is_simple_bin(Ss) ->
  -    all(fun (#c_bitstr{val=E,size=S}) ->
  -                is_simple(E) andalso is_simple(S)
  +    all(fun (Seg) ->
  +                is_simple(bitstr_val(Seg)) andalso is_simple(bitstr_size(Seg))
           end, Ss).
  +
  +%%  Constructor functions for building Core forms. These now just call
  +%%  functions in cerl.
  +
  +c_module(Name, Exp, Defs) ->
  +    cerl:c_module(Name, Exp, Defs).
  +
  +update_c_module(Mod, Name, Exp, Atts, Defs) ->
  +    cerl:update_c_module(Mod, Name, Exp, Atts, Defs).
  +
  +ann_c_call(Ann, M, F, As) ->
  +    cerl:ann_c_call(Ann, M, F, As).
  +
  +ann_c_try(Ann, E, Vs, B, Evs, H) ->
  +    cerl:ann_c_try(Ann, E, Vs, B, Evs, H).
  +
  +ann_c_fun(Ann, Vs, B) ->
  +    cerl:ann_c_fun(Ann, Vs, B).
  +
  +fun_vars(Fun) -> cerl:fun_vars(Fun).
  +fun_body(Fun) -> cerl:fun_body(Fun).
  +
  +ann_c_primop(Ann, N, As) ->
  +    cerl:ann_c_primop(Ann, N, As).
  +
  +ann_c_let(Ann, Vs, A, B) ->
  +    cerl:ann_c_let(Ann, Vs, A, B).
  +
  +ann_c_letrec(Ann, Defs, B) ->
  +    cerl:ann_c_letrec(Ann, Defs, B).
  +
  +ann_c_catch(Ann, Body) ->
  +    cerl:ann_c_catch(Ann, Body).
  +
  +ann_c_receive(Ann, Cs, To, A) ->
  +    cerl:ann_c_receive(Ann, Cs, To, A).
  +
  +ann_c_case(Ann, E, Cs) ->
  +    cerl:ann_c_case(Ann, E, Cs).
  +
  +ann_c_clause(Ann, Ps, B) ->                         %Default true guard
  +    cerl:ann_c_clause(Ann, Ps, B).
  +
  +ann_c_clause(Ann, Ps, G, B) ->
  +    cerl:ann_c_clause(Ann, Ps, G, B).
  +
  +ann_c_seq(Ann, A, B) ->
  +    cerl:ann_c_seq(Ann, A, B).
  +
  +update_c_seq(Node, A, B) ->
  +    cerl:update_c_seq(Node, A, B).
  +
  +is_c_seq(Node) -> cerl:is_c_seq(Node).
  +
  +seq_arg(Seq) -> cerl:seq_arg(Seq).
  +seq_body(Seq) -> cerl:seq_body(Seq).
  +
  +c_fname(N, A) -> cerl:c_fname(N, A).
  +
  +ann_c_apply(Ann, Op, As) ->
  +    cerl:ann_c_apply(Ann, Op, As).
  +
  +ann_c_values(Vs) ->
  +    cerl:ann_c_values([], Vs).
  +
  +get_ann(Node) -> cerl:get_ann(Node).
  +set_ann(Node, Ann) -> cerl:set_ann(Node, Ann).
  +
  +c_alias(Var, Pat) -> cerl:c_alias(Var, Pat).
  +alias_var(Alias) -> cerl:alias_var(Alias).
  +alias_pat(Alias) -> cerl:alias_pat(Alias).
  +
  +c_atom(A) -> cerl:c_atom(A).
  +c_int(I) -> cerl:c_int(I).
  +c_float(F) -> cerl:c_float(F).
  +c_nil() -> cerl:c_nil().
  +
  +c_lit(Ann, Val) -> cerl:ann_abstract(Ann, Val). %Generic literal
  +c_lit(Val) -> cerl:abstract(Val).
  +is_literal(Node) -> cerl:is_literal(Node).
  +lit_val(Lit) -> cerl:concrete(Lit).
  +
  +c_cons(Hd, Tl) -> cerl:c_cons(Hd, Tl).
  +c_cons_skel(Hd, Tl) -> cerl:c_cons_skel(Hd, Tl).
  +cons_hd(Cons) -> cerl:cons_hd(Cons).
  +cons_tl(Cons) -> cerl:cons_tl(Cons).
  +
  +c_tuple(Es) -> cerl:c_tuple(Es).
  +update_c_tuple(Tup, Es) ->
  +    cerl:update_c_tuple(Tup, Es).
  +tuple_es(Tup) -> cerl:tuple_es(Tup).
  +
  +c_var(N) -> cerl:c_var(N).
  +
  +ann_c_binary(Ann, Segs) -> cerl:ann_c_binary(Ann, Segs).
  +update_c_binary(Bin, Segs) ->
  +    cerl:update_c_binary(Bin, Segs).
  +binary_segments(Bin) -> cerl:binary_segments(Bin).
  +
  +c_bitstr(Val, Sz, Un, Ty, Fs) ->
  +    cerl:c_bitstr(Val, Sz, Un, Ty, Fs).
  +update_c_bitstr(Bit, Val, Sz, Un, Ty, Fs) ->
  +    cerl:update_c_bitstr(Bit, Val, Sz, Un, Ty, Fs).
  +bitstr_val(Bit) -> cerl:bitstr_val(Bit).
  +bitstr_size(Bit) -> cerl:bitstr_size(Bit).
  +bitstr_unit(Bit) -> cerl:bitstr_unit(Bit).
  +bitstr_type(Bit) -> cerl:bitstr_type(Bit).
  +bitstr_flags(Bit) -> cerl:bitstr_flags(Bit).
  +
  +ann_c_map(Ann, Arg, Ps) ->
  +    cerl:ann_c_map(Ann, Arg, Ps).
  +
  +ann_c_map_pair(Ann, Op, Key, Val) ->
  +    cerl:ann_c_map_pair(Ann, Op, Key, Val).
  +
  +data_es(Data) -> cerl:data_es(Data).
  
positive.code:     mapfoldl(fun (Cl, Sta) -> comp_match_clause(Cl, Env, L, Sta) end,
               St, Cls).
  
  %% comp_match_clause(Clause, Env, L, State) -> {#c_clause{},State}.
  %% (Pats [(when Guard)] . Body)
  %% Pats is here a list of patterns which are the function clause
  %% arguments. This must be compiled to a list of patterns not a
  
negative.code: 
  %% lambda_arity([Args|_]) -> length(Args).
  
  %% comp_match_lambda(Clauses, Env, Line, State) -> {c_fun(),State}.
  %% (match-lambda (Pat ...) ...).
  
  comp_match_lambda(Cls, Env, L, St0) ->
  