BAP Online Manuals : Library Reference : Library by Name : retractall
Previous: retract
Next: rmdir

6.2.113. retractall

discards information from the database.

SYNOPSIS

retractall(Term)

SYNTAX

retractall(Term) (i)

ARGUMENTS

void(Term) (i) Term to be removed from database entries

DESCRIPTION

This is a standard PROLOG built-in. It succeeds once and remove all database entries that match Term on the way. Different from standard prolog you may use this with an uninstantiated variable to remove all entries.
Its definition is:

PREDICATE retractall(void).
retractall(Term):-
	retract(Term),fail.
retractall(_).

EXAMPLE

asserta(hello),
asserta(world),
database(X),
	write(X),nl,
	fail
;
retractall(X).

ERRORS

No runtime errors.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

asserta , assertz , retract , clause , database , listing


BAP Online Manuals : Library Reference : Library by Name : retractall
Previous: retract
Next: rmdir