[ ECLiPSe Control built-in.|Group Index| Full Index]

delay(?Variables, +Goal)

Delay the Goal on all variables in the term Variables.

?Variables
Any Prolog term.
+Goal
A callable term.

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.

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
Goal is not instantiated.
(5) Type error
Goal is not a callable term.
(60)
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

make_suspension / 3, insert_suspension / 3