unknown/2

Synopsis

unknown(-OldAction, +NewAction)

Unifies OldAction with the current action on unknown procedures, and then sets the current action to NewAction.

Arguments


OldAction one of [error,fail]

NewAction one of [error,fail]

Description

This action determines what happens when an undefined predicate is called:


error
Undefined procedures will raise an exception
fail
Undefined procedures will simply fail

The default action is error. trace is accepted as a synonym for error for backword compatibility. Note that

     | ?- unknown(Action, Action).
     

just returns Action without changing it.

Procedures that are known to be dynamic just fail when there are no clauses for them. Their behavior is not affected by unknown/2. For more information on dynamic procedures, see ref-mdb-dsp.

See Also

unknown_predicate_handler/3