repeatbehaves as if defined by:
repeat. repeat :- repeat.
repeat succeeds when first called, thanks
to the first clause. If the Prolog interpreter subsequently
backtracks, the second clause (
repeat :- repeat.)
is tried. This initiates a new call to
which succeeds via the first clause, and so on.
For a practical example of a use of