anchor.diff:      foldl(fun analyse/2, Dict, tuple_to_list(T)); 
   analyse(X, Dict) ->
       case dict:find(X, Dict) of
  -	{ok, Val} ->
  -	    dict:store(X, Val+1, Dict);
  -	error ->
  -	    dict:store(X, 1, Dict)
  +    {ok, Val} ->
  +        dict:store(X, Val+1, Dict);
  +    error ->
  +        dict:store(X, 1, Dict)
       end.
   
   encode_obj(X) when is_atom(X) -> encode_atom(X);
  
positive.code: 
  -compile(export_all).
  
  -export([decode_init/0, decode/1, decode/2, encode/1, encode/2]).
  -export([encode_print/1, deabstract/1]).
  
  -import(lists, [foldl/3, reverse/1, map/2, seq/2, sort/1]).
  
  
  bug() ->
      C = decode("{'abc"),
  
negative.code: 
  %% intro() -> single line terminated with \n
  
  decode(S) ->
      decode(S, ?MAX_DECODE_SIZE).
  
  decode(S, {more, Fun}) -> 
      Fun(S);
  decode(Str, MaxSize) when is_binary(Str), is_integer(MaxSize) ->
      case catch decode(Str, decode_init(MaxSize)) of
          {done, Term, Rest} -> {ok, Term, Rest};
          {more, _} = More -> More;
          {error, _} = Error -> Error;
          {'EXIT', Error} -> {error, Error}
      end.
  
  decode_init() ->
      decode_init(?MAX_DECODE_SIZE).
  
  decode_init(MaxSize) ->
      {more, fun(I) -> decode1(I, [[]], dict:new(), MaxSize) end}.
  
  
  decode1(_S, _Stack, _D, MaxSize) when MaxSize < 0 ->
      exit(size);
  decode1(S, Stack, D, MaxSize) ->
      decode(S, Stack, D, MaxSize).
  
  decode(<<$',T/binary>>, Stack, Dict, MaxSize) ->
      get_stuff(T, $', <<>>, Stack, Dict, MaxSize);
  decode(<<$~,T/binary>>, [[Int|Stack]|S1], Dict, MaxSize) when is_integer(Int), Int >= 0 ->
      collect_binary(Int, T, <<>>, [Stack|S1], Dict, MaxSize - Int + erts_debug:size(Int));
  decode(<<$~,_/binary>>, _Stack, _Dict, _MaxSize) ->
      exit(tilde);
  decode(<<$%, T/binary>>, Stack, Dict, MaxSize) ->
      get_stuff(T, $%, <<>>, Stack, Dict, MaxSize);
  decode(<<$", T/binary>>, Stack, Dict, MaxSize) ->
      get_stuff(T, $", <<>>, Stack, Dict, MaxSize);
  decode(<<$`, T/binary>>, Stack, Dict, MaxSize) ->
      get_stuff(T, $`, <<>>, Stack, Dict, MaxSize);
  decode(<<$-, T/binary>>, Stack, Dict, MaxSize) ->
      collect_int(T, 0, '-', Stack, Dict, MaxSize);
  decode(<<H, T/binary>>, Stack, Dict, MaxSize) when $0 =< H, H =< $9 ->
      collect_int(T, H-$0, '+', Stack, Dict, MaxSize);
  decode(<<${, T/binary>>, Stack, Dict, MaxSize) ->
      decode1(T, [[]|Stack], Dict, MaxSize);
  decode(<<$}, T/binary>>, [H|Stack], Dict, MaxSize) ->
      decode1(T, push(list_to_tuple(reverse(H)),Stack), Dict, MaxSize);
  decode(<<$&, T/binary>>, [ [H1,H2|T1] | Stack], Dict, MaxSize) ->
      decode1(T, [[[H1|H2]|T1]|Stack], Dict, MaxSize);
  decode(<<$#, T/binary>>, Stack, Dict, MaxSize) ->
      decode1(T, push([], Stack), Dict, MaxSize);
  decode(<<$$, T/binary>>, [[X]], _Dict, _MaxSize) ->
      {done, X, T};
  decode(<<$>,Key, T/binary>>, [[Val|R]|Stack], Dict, MaxSize) ->
      decode1(T, [R|Stack], dict:store(Key,Val,Dict), MaxSize);
  decode(<<H, T/binary>>, Stack, Dict, MaxSize) ->
      case special(H) of
      true ->
          decode1(T, Stack, Dict, MaxSize);
      false ->
          Term = dict:fetch(H, Dict),
          decode1(T, push(Term, Stack), Dict, MaxSize - erts_debug:flat_size(Term))
      end;
  decode(<<>>, Stack, Dict, MaxSize) ->
      {more, fun(I) -> decode1(I, Stack, Dict, MaxSize) end};
  decode(X, _Stack, _Dict, _MaxSize) ->
      {error, {eof, X}}.
             
  get_stuff(<<$\\,H,T/binary>>, Stop, L, Stack, Dict, MaxSize) -> 
      get_stuff(T, Stop, <<L/binary,H>>, Stack, Dict, MaxSize);
  get_stuff(<<$',T/binary>>, $', L, Stack, Dict, MaxSize)  -> 
      Atom = list_to_existing_atom(z_convert:to_list(L)),
      decode1(T, push(Atom,Stack), Dict, MaxSize - erts_debug:flat_size(Atom));
  get_stuff(<<$",T/binary>>, $", L, Stack, Dict, MaxSize)  -> 
      decode1(T, push(L,Stack), Dict, MaxSize - erts_debug:flat_size(L));
  get_stuff(<<$`,T/binary>>, $`, L, [Top|Stack], Dict, MaxSize)  -> 
      decode1(T, push({'$TYPE', L, Top},Stack), Dict, MaxSize - erts_debug:flat_size(L));
  get_stuff(<<$%,T/binary>>, $%, _L, Stack, Dict, MaxSize)  -> 
      decode1(T, Stack, Dict, MaxSize);
  get_stuff(<<H,T/binary>>, Stop, L, Stack, Dict, MaxSize) -> 
      get_stuff(T, Stop, <<L/binary, H>>, Stack, Dict, MaxSize);
  get_stuff(<<>>, Stop, L, Stack, Dict, MaxSize) ->
      {more, fun(I) ->           
             get_stuff(I, Stop, L, Stack, Dict, MaxSize) end}.
  
  collect_binary(0, T, L, Stack, Dict, MaxSize) ->
      expect_tilde(T, push(L, Stack), Dict, MaxSize);
  collect_binary(N, <<H,T/binary>>, L, Stack, Dict, MaxSize) ->
      collect_binary(N-1, T, <<L/binary, H>>, Stack, Dict, MaxSize);
  collect_binary(N, <<>>, L, Stack, Dict, MaxSize) ->
      {more, fun(I) -> collect_binary(N, I, L, Stack, Dict, MaxSize) end}.
  
  expect_tilde(<<$~, T/binary>>, Stack, Dict, MaxSize) ->
      decode1(T, Stack, Dict, MaxSize);
  expect_tilde(<<>>, Stack, Dict, MaxSize) ->
      {more, fun(I) -> expect_tilde(I, Stack, Dict, MaxSize) end};
  expect_tilde(<<H,_/binary>>, _Stack, _Dict, _MaxSize) ->
      exit({expect_tilde, H}).
  
  push(X, [Top|Rest]) -> 
  