forces a failure.
fail/0 fails always. It can force backtracing.
Conjuncted subgoals that follow after fail/0 can never be executed.
Be careful with calling fail/0 after a never-ending loop (for
example see repeat/0).
| write('this is going to fail'), fail. | Fails with output on the current outputstream 'this is going to fail'. |
| repeat,write(endless),nl,fail. | writes infinitely on the current outputstream 'endless'. |
This predicate is part of the ISO-Prolog Standard.
| scroll to top |
|