anchor.diff:          Err ->
               Err
       end.
  -
  -%%====================================================================
  -%% Runtime API
  -%%====================================================================
  --spec reverse([any()], pos_integer(), pos_integer() | infinity) -> [any()].
  -
  -reverse(L, Min, Max) ->
  -    reverse(L, Min, Max, 0, []).
  -
  -reverse([H|T], Min, Max, Count, Acc) ->
  -    reverse(T, Min, Max, Count+1, [H|Acc]);
  -reverse([], Min, Max, Count, Acc) when Count >= Min, Count =< Max ->
  -    Acc.
   
   %%====================================================================
   %% Runtime decoders/encoders
  
positive.code:   when not is_atom(RefName) ->
      bad_spec({wrong_ref_name, RefName, Name});
  prepare_ref(Name, #ref{name = RefName, min = Min}, _)
    when not (is_integer(Min) andalso Min >= 0) ->
      bad_spec({wrong_ref_min, Min, RefName, Name});
  prepare_ref(Name, #ref{name = RefName, max = Max}, _)
    when not ((is_integer(Max) andalso Max > 0) orelse (Max == infinity)) ->
      bad_spec({wrong_ref_max, Max, RefName, Name});
  prepare_ref(Name, #ref{name = RefName, min = Min, max = Max}, _)
    when Min > Max ->
      bad_spec({ref_min_over_max, Min, Max, RefName, Name});
  prepare_ref(Name, #ref{name = RefName, label = Label}, _)
    when not is_atom(Label) ->
      bad_spec({wrong_ref_label, Label, RefName, Name});
  
negative.code: %% Generator API
  -export([compile/1]).
  %% Runtime API
  -export([format_error/1, get_attr/2]).
  %% Runtime built-in decoders/encoders
  -export([dec_int/1, dec_int/3, dec_enum/2,
           enc_int/1, enc_enum/1, not_empty/1]).
  