anchor.diff:  	  timer := Timer},
       loop(Parent, Debug, NewS).
   
  +loop_event(
  +  Parent, Debug,
  +  #{callback_mode := undefined,
  +    module := Module} = S,
  +  Events,
  +  State, Data, P, Event, Hibernate) ->
  +    %% Cache the callback_mode() value
  +    case
  +	try Module:callback_mode()
  +	catch
  +	    Result -> Result
  +	end
  +    of
  +	CallbackMode ->
  +	    case callback_mode(CallbackMode) of
  +		true ->
  +		    loop_event(
  +		      Parent, Debug,
  +		      S#{callback_mode := CallbackMode},
  +		      Events,
  +		      State, Data, P, Event, Hibernate);
  +		false ->
  +		    error({callback_mode,CallbackMode})
  +	    end
  +    end;
   loop_event(
     Parent, Debug,
     #{callback_mode := CallbackMode,
  
positive.code: %% an {ok, ...} tuple.  Thereafter the state callbacks are called
  %% for all events to this server.
  -callback init(Args :: term()) ->
      {callback_mode(), state(), data()} |
      {callback_mode(), state(), data(), [action()] | action()} |
      'ignore' |
      {'stop', Reason :: term()}.
  
  %% Example state callback for callback_mode() =:= state_functions
  %% state name 'state_name'.
  %%
  %% In this mode all states has to be type state_name() i.e atom().
  %%
  %% Note that state callbacks and only state callbacks have arity 5
  %% and that is intended.
  -callback state_name(
  	    event_type(),
  	    EventContent :: term(),
  	    Data :: data()) ->
      state_function_result().
  %%
  %% State callback for callback_mode() =:= handle_event_function.
  %%
  %% Note that state callbacks and only state callbacks have arity 5
  %% and that is intended.
  -callback handle_event(
  	    event_type(),
  	    EventContent :: term(),
  
negative.code:    [start/3,start/4,start_link/3,start_link/4,
      stop/1,stop/3,
      cast/2,call/2,call/3,
      enter_loop/4,enter_loop/5,enter_loop/6,
      reply/1,reply/2]).
  
  %% gen callbacks
  