[ Obsolete | Reference Manual | Alphabetic Index ]
delay(?Variables, +Goal)
Delay the Goal on all variables in the term Variables.
- Variables
- Any Prolog term.
- Goal
- A callable term.
This built-in predicate is obsolete!
Description
The specified goal Goal is made a suspended goal such that it will be
woken whenever any of the variables in the term Variables is bound (even
to another variable). This predicate is obsolete, a more precise
control over suspending and waking is obtained using make_suspension/3
and insert_suspension/3,4 and with the suspend.pl library.
Modes and Determinism
Exceptions
- (4) instantiation fault
- Goal is not instantiated.
- (5) type error
- Goal is not a callable term.
- (60) referring to an undefined procedure
- Goal does not refer to an existing procedure.
Examples
[eclipse 1]: delay(X, writeln(hello)).
X = X
Delayed goals:
writeln(hello)
yes.
[eclipse 2]: delay(X, writeln(hello)),
writeln(one),
X=1, % causes waking
writeln(two).
one
hello
two
X = 1
yes.
[eclipse 3]: delay([X,Y], writeln(X)), X=Y.
X
X = X
Y = X
yes.
See Also
suspend / 3, make_suspension / 3, insert_suspension / 3