[ Control | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]
exit_block(++TagExit)
Continues the program at the recovery procedure of the block/3 predicate
whose Tag argument unifies with TagExit.
- ++TagExit
- An atom or integer.
Description
Can only occur after block(Goal,Tag, Recovery) has been invoked. First
Goal is called and if this succeeds then block/3 succeeds. If Goal
fails then so does the call of block/3. If, however, during the
execution of Goal there is a call of exit_block(TagExit) such that Tag
unifies with TagExit, then block/3 calls the goal Recovery, and succeeds
or fails according to whether Recovery succeeds or fails. If Tag does
not unify with TagExit, the system continues looking for an earlier
invocation of block/3.
Fail Conditions
None.
Resatisfiable
No.
Exceptions
- (5) type error
- TagExit is not an atom.
- (230) uncaught exception
- TagExit does not unify with a Tag of any uncompleted call of block/3.
Examples
Success:
[eclipse]: [user].
go :- getval(i,2) -> exit_block(h).
user compiled 100 bytes in 0.02 seconds
yes.
% write 'hello' if global variable i is 2.
[eclipse]: setval(i,1), block(go, h, write(hello)).
no.
[eclipse]: setval(i,2), block(go, h, write(hello)).
hello
yes.
Error:
exit_block("a"). (Error 5).
exit_block(a). (Error 230).
See Also
block / 3