anchor.diff:  %%% Internal functions
   %%%===================================================================
   state_from_params(OrigState = #state{level = OldLevel,
  -                                     table = OldTable,
                                        application = OldApplication,
                                        tn_event = OldTableEvent}, Params) ->
  +    {Table, TableOpts} = case proplists:get_value(tablefun, Params) of
  +                             TableFun when is_function(TableFun, 0) ->
  +                                 TableFun();
  +                             _ -> exit({badarg, missing_tablefun})
  +                         end,
       Level = proplists:get_value(level, Params, OldLevel),
  -    Table = proplists:get_value(table, Params, OldTable),
       TableEvent = proplists:get_value(tn_event, Params, OldTableEvent),
       Application = proplists:get_value(application, Params, OldApplication),
       Modules = case application:get_key(Application, modules) of
  
positive.code: %%%===================================================================
  %%% gen_event callbacks
  %%%===================================================================
  setup_table(Name, Fields, Types, Defaults) ->
      RecordName = element(1, Defaults),
      try
          imem_meta:create_check_table(
            Name, {Fields, Types, Defaults},
            [{record_name, RecordName}, {type, ordered_set},
             {purge_delay,430000}],
            lager_imem),
          mpro_dal:unsubscribe({table, ddConfig, simple}),
          mpro_dal:subscribe({table, ddConfig, simple})
  
negative.code:         level = info,
          application,
          modules = [],
          table,
          table_opts = []}).
  
  %%%===================================================================
  %%% trace
  