Logtalk reference manual
Built-in method: retractall/1
Contents > Reference Manual > Built-in Methods > retractall/1

## retractall/1

#### Description

    retractall(Head)

Retracts all matching predicates from an object.

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.

#### Template and modes

    retractall(+callable)

#### Errors

Head is a variable:
  `instantiation_error`
Head is neither a variable nor a callable term:
  `type_error(callable, Head)`
The predicate indicator of Head, Functor/Arity, is that of a private predicate:
  `permission_error(modify, private_predicate, Functor/Arity)`
The predicate indicator of Head, Functor/Arity, is that of a protected predicate:
  `permission_error(modify, protected_predicate, Functor/Arity)`
The predicate indicator of Head, Functor/Arity, is that of a static predicate:
  `permission_error(modify, static_predicate, Functor/Arity)`
The predicate indicator of Head, Functor/Arity, is not declared:
  `existence_error(predicate_declaration, Functor/Arity)`

#### Examples

To retract all matching predicate definitions in this:
  `retractall(Head)`
To retract all matching public or protected predicate definitions in self:
  `::retractall(Head)`
To retract all matching public predicate definitions in an explicit object:
  `Object::retractall(Head)`