Hook predicates are called by the system. They enable you to
modify Quintus Prolog's behavior. They are either undefined by default (like
portray/1
and message_hook/3
) or else they have a simple
default definition that is dynamic and/or multifile (like
file_search_path/1
and library_directory/1
, which are
multifile by default).
If they do have a default definition, a definition provided by the user overrides it within the module where it is redefined. The idea of a hook predicate is that its clauses are independent of each other, and it makes sense to spread their definitions over several files (which may be written by different people).