11.3.238 unknown/2 [development]

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,trace,warning]
NewAction
one of [error,fail,trace,warning], must be nonvar

Description

This action determines what happens when an undefined predicate is called, and user:unknown_predicate_handler/3 does not handle the goal, by accessing the unknown Prolog flag:

trace
Causes calls to undefined predicates to be reported and the debugger to be entered at the earliest opportunity.
fail
Causes calls to such predicates to fail.
warning
Causes calls to such predicates to display a warning message and then fail.
error
Causes calls to such predicates to raise an exception (the default). See ref-ere.
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.

Exceptions

instantiation_error
type_error
domain_error
Invalid NewAction.

See Also

Undefined Predicates, ref-ere.


Send feedback on this subject.