Next: mpg-ref-runtime_entry, Previous: mpg-ref-retract, Up: mpg-bpr [Contents][Index]
retractall/1
ISOretractall(+Head)
Removes every clause in module M whose head matches Head.
callable, must be nonvar
Head of a Prolog clause.
Head must be instantiated to a term that looks
like a call to a dynamic procedure.
For example, to retract all the clauses of foo/3
, you would write
| ?- retractall(foo(_,_,_)).
Head may be preceded by a M: prefix, in which case the clauses are retracted from module M instead of the calling module.
retractall/1
is useful for erasing all the clauses of a dynamic
procedure without forgetting that it is dynamic; abolish/1
will
not only erase all the clauses, but will also forget absolutely
everything about the procedure. retractall/1
only erases the
clauses. This is important if the procedure is called later on.
Since retractall/1
erases all the dynamic clauses whose
heads match Head, it has no choices to make, and is
determinate. If there are no such clauses, then it succeeds trivially.
None of the variables in Head will be instantiated by this
command.
If the predicate did not previously exist, then
it is created as a dynamic predicate and retractall/1
succeeds.
instantiation_error
Head or Module is uninstantiated.
type_error
Head is not a callable.
permission_error
the procedure corresponding to Head is not dynamic.
retract/1
, ref-mdb-rcd.