check_advice/[0,1] development

Synopsis

check_advice

check_advice(+PredSpecs)

Enable advice checking.

Arguments


PredSpecs gen_pred_spec_tree [MOD]
A list of predicate specifications.

Description

check_advice/1 is used to enable advice checking on all predicates specified in PredSpecs. check_advice/0 enables advice checking on all predicates for which advice has been added. When advice checking is enabled for a predicate, and execution of that predicate reaches an advised port, the term carrying the current instantiation of the Prolog call is unified against the goal term of the advice. If the two unify, the action associated with the goal and port is executed then failed over. If there are multiple pieces of advice associated with the goal and port, they are sequentially called and failed over.

This predicate is not supported in runtime systems.

Exceptions


instantiation_error
if the argument is not ground.
type_error
if a Name is not an atom or an Arity not an integer.
domain_error
if a PredSpec is not a valid procedure specification, or if an Arity is specified as an integer outside the range 0-255.
permission_error
if a specified procedure is built-in.

Tips

check_advice/0 behaves as though implemented by

     check_advice :-
             current_advice(Goal, Port, Action),
             functor(Goal, Name, Arity),
             check_advice(Name/Arity),
             fail.
     check_advice.
     

See Also

add_advice/3, remove_advice/3, current_advice/3, nocheck_advice/[0,1] dbg-adv