retract(Head) retract((Head:-Body))
Retracts a clause for a dynamic predicate. When the predicate indicator for Head
is declared in a uses/2
or use_module/2
directive, the clause is retracted in the referenced object or module. Otherwise the clause is retracted in an object's dynamic predicate. On backtracking, the predicate retracts the next matching clause.
This method may be used to retract clauses for predicates that are not declared dynamic for dynamic objects provided that the predicates are declared in this.
retract(+clause)
instantiation_error
type_error(callable, Head)
permission_error(modify, private_predicate, Name/Arity)
permission_error(modify, protected_predicate, Name/Arity)
permission_error(modify, static_predicate, Name/Arity)
existence_error(predicate_declaration, Name/Arity)
retract(Clause)
::retract(Clause)
Object::retract(Clause)
abolish/1
, asserta/1
, assertz/1
, clause/2
, retractall/1
dynamic/0
, dynamic/1
uses/2
, use_module/2