current_advice/3 development


current_advice(*Goal, *Port, *Action)

Provides a means for checking what advice is present.


Goal callable [MOD]
any term.
Port one of [call,exit,done,redo,fail]

Action callable [MOD]
any term.


Unifies Goal with the goal term, Port with the port, and Action with the action term of currently existing user-defined advice. None of the three arguments need to be instantiated.

This predicate is not supported in runtime systems.


To backtrack through all the advice that exists for a predicate mypred/2, you can use the goal

     | ?- current_advice(mypred(_,_), Port, Action).

If you are only interested in the advice for mypred/2 on the call port, use

     | ?- current_advice(mypred(_,_), call, Action).

To determine what predicates you told to call format/2, use

     | ?- current_advice(Goal, Port, format(_,_)).

See Also

add_advice/3, remove_advice/3, check_advice/[0,1], nocheck_advice/[0,1]