anchor.diff:  is_packed(#field{opts=Opts}) ->
       lists:member(packed, Opts).
   
  +smember(Type, UsedTypes) -> %% set-member
  +    sets:is_element(Type, UsedTypes).
  +
   index_seq([]) -> [];
   index_seq(L)  -> lists:zip(lists:seq(1,length(L)), L).
   
  
positive.code: %% -- encoders -----------------------------------------------------
  
  analyze_defs(Defs) ->
      #anres{reachable_enums = find_reacable_enums(Defs)}.
  
  find_reacable_enums(Defs) ->
      lists:foldl(fun({{msg, _MsgName}, Fields}, Acc) ->
                          lists:foldl(fun(#field{type={enum,EnumName}}, FAcc) ->
                                              sets:add_element(EnumName, FAcc);
                                         (_Field, FAcc) ->
                                              FAcc
                                      end,
                                      Acc,
                                      Fields);
                     (_Def, Acc) ->
                          Acc
                  end,
                  sets:new(),
                  Defs).
  
  %% -- generating code ----------------------------------------------
  
negative.code:      format_initial_msgs(Defs),
       format_msg_decoders(Defs, Opts)].
  
  format_enum_decoders(Defs, #anres{used_types=UsedTypes}) ->
      %% FIXME: enum values can be negative, but "raw" varints are positive
      %%        insert a 2-complement in the mapping in order to move computations
      %%        from runtime to compiletime??
  