anchor.diff:      end,
       Ref;
   next_iterator(It, '$end_of_table') ->
  +    %% general catch-all for all iterators
       It#metadata_iterator{done=true,
                            pos=undefined,
                            obj=undefined};
   next_iterator(It=#metadata_iterator{prefix=undefined,match=undefined},Next) ->
  +    %% full-prefix iterator
       It#metadata_iterator{pos=Next};
   next_iterator(It, {[Next], Cont}) ->
  +    %% sub-prefix or key/value iterator
       It#metadata_iterator{pos=Cont,
                            obj=Next}.
   
  +%% universal empty iterator
   empty_iterator(FullPrefix, KeyMatch, Tab) ->
       #metadata_iterator{
                   prefix=FullPrefix,
  
positive.code:        tab=Tab
        };
  new_iterator(undefined, Prefix, Tab, {[First], Cont}) ->
      #metadata_iterator{
         prefix=undefined,
         match=Prefix,
  
negative.code:                }.
  
  new_iterator(undefined, undefined, Tab) ->
      %% full-prefix iterator
      ets:safe_fixtable(Tab, true),
      new_iterator(undefined, undefined, Tab, ets:first(Tab));
  new_iterator(undefined, Prefix, Tab) ->
      %% sub-prefix iterator
      new_iterator(undefined, Prefix, Tab,
                   ets:select(Tab, [{{{Prefix,'$1'},'_'},[],['$1']}], 1));
  new_iterator(FullPrefix, KeyMatch, Tab) ->
      %% key/value iterator
      ObjectMatch = iterator_match(KeyMatch),
      new_iterator(FullPrefix, KeyMatch, Tab, ets:match_object(Tab, ObjectMatch, 1)).
  
  new_iterator(FullPrefix, KeyMatch, Tab, '$end_of_table') ->
      %% catch-all for empty iterator of all types
      empty_iterator(FullPrefix, KeyMatch, Tab);
  new_iterator(undefined, undefined, Tab, First) ->
      %% full-prefix iterator
      #metadata_iterator{
         prefix=undefined,
         match=undefined,
  