anchor.diff:  -export([init/1, empty/2, ready/2, full/2,
            handle_event/3, handle_sync_event/4, handle_info/3,
            terminate/3, code_change/4]).
  +
  +-import(lists, [reverse/1]).
   
   -record(state, {count = 0, mll = <<>>, body = <<>>, msgs = []}).
   
  
positive.code: append({Count, MLL, Body, Msgs}, NewMsg) ->
      {NewMLL, NewBody} = append_to_binary(MLL, Body, NewMsg),
      NewState = {Count+1, NewMLL, NewBody, Msgs},
      Full = {next_state, full, NewState},
      case byte_size(NewMLL) + byte_size(NewBody) of
          X when X >= ?PARC_MAX_MEM -> Full;
          _ -> case (Count + 1) of
              ?PARC_MAX_MSG -> Full;
              _ -> {next_state, ready, NewState}
          end
      end.
  
negative.code: concat({Count, MLL, Body, [Msg|More]}) ->
      {NewMLL, NewBody} = append_to_binary(MLL, Body, Msg),
      NewState = {Count+1, NewMLL, NewBody, More},
      case byte_size(NewMLL) + byte_size(NewBody) of
          X when X >= ?PARC_MAX_MEM ->
              {next_state, full, NewState#state{msgs = reverse(More)}};
          _ -> case (Count + 1) of
              ?PARC_MAX_MSG ->
                  {next_state, full, NewState#state{msgs = reverse(More)}};
              _ -> concat(NewState)
          end
      end.
  