anchor.diff:  
   %% check_exports(Exports, Funcs, State) -> State.
   
  -check_exports(all, _, St) -> St;                %All is all
   check_exports(Exps, Fs, St) ->
  -    foldl(fun (E, S) ->
  +    Fun = fun (E, L, S) ->
                     case is_element(E, Fs) of
                         true -> S;
  -                      false -> add_error(9999, {unbound_func,E}, S)
  +                      false -> undefined_func_error(L, E, S)
                     end
  -          end, St, Exps).
  -
  -%% add_exports(Old, More) -> New.
  -
  -add_exports(all, _) -> all;
  -add_exports(Old, More) -> union(Old, More).
  +          end,
  +    orddict:fold(Fun, St, Exps).
  +
  +%% add_exports(More, Line, Exports) -> New.
  +%%  Add exports preserving line number of earliest entry.
  +
  +add_exports(More, L, Exps) ->
  +    Fun = fun (F, Es) ->
  +                  orddict:update(F, fun (Old) -> Old end, L, Es)
  +          end,
  +    lists:foldl(Fun, Exps, More).
   
   %% check_expr(Expr, Env, Line, State) -> State.
   %% Check an expression.
  
positive.code: format_error(bad_funcs) -> "bad function list";
  format_error(bad_body) -> "bad body";
  format_error(bad_clause) -> "bad clause";
  format_error(bad_args) -> "bad arguments";
  format_error(bad_gargs) -> "bad guard arguments";
  format_error(bad_alias) -> "bad alias";
  format_error(bad_arity) -> "head arity mismatch";
  format_error({bad_attribute,A}) ->
      lfe_io:format1("bad attribute: ~w", [A]);
  format_error({bad_meta,M}) ->
      lfe_io:format1("bad metadata: ~w", [M]);
  format_error({bad_form,Type}) ->
      lfe_io:format1("bad form: ~w", [Type]);
  format_error({bad_gform,Type}) ->
      lfe_io:format1("bad guard form: ~w", [Type]);
  format_error({bad_pat,Type}) ->
      lfe_io:format1("bad pattern: ~w", [Type]);
  format_error({unbound_symb,S}) ->
      lfe_io:format1("unbound symbol: ~w", [S]);
  format_error({unbound_func,F}) ->
      lfe_io:format1("unbound function: ~w", [F]);
  format_error({multi_var,S}) ->
      lfe_io:format1("multiple variable: ~w", [S]);
  format_error({redef_fun,F}) ->
      lfe_io:format1("redefining function: ~w", [F]);
  format_error({bad_fdef,F}) ->
      lfe_io:format1("bad function definition: ~w", [F]);
  format_error({illegal_literal,Lit}) ->
      lfe_io:format1("illegal literal value: ~w", [Lit]);
  format_error({illegal_pattern,Pat}) ->
      lfe_io:format1("illegal pattern: ~w", [Pat]);
  format_error(illegal_guard) -> "illegal guard";
  format_error(illegal_bitseg) -> "illegal bit segment";
  format_error({illegal_mapkey,Key}) ->
      lfe_io:format1("illegal map key: ~w", [Key]);
  format_error({undefined_bittype,S}) ->
      lfe_io:format1("bit type ~w undefined", [S]);
  format_error(bittype_unit) ->
      "bit unit size can only be specified together with size";
  format_error(illegal_bitsize) -> "illegal bit size";
  format_error({deprecated,What}) ->
      lfe_io:format1("deprecated: ~s", [What]);
  
negative.code: illegal_mapkey_error(L, K, St) ->
      add_error(L, {illegal_mapkey,K}, St).
  
  illegal_bitsize_error(L, St) ->
      add_error(L, illegal_bitsize, St).
  
  bad_pat_error(L, F, St) ->
      add_error(L, {bad_pat,F}, St).
  
  