provide a hook facility for events, used by repl