[ ECLiPSe event built-in|Group Index| Full Index]

make_after_goal(+Event, +Goal)

Suspends goal Goal which will be triggered when the event Event is raised.

+Event Atom +Goal Prolog term

Description

Creates a suspended goal which is then triggered (woken) when the event Event is raised. This predicate is provided as a convienence so that the user does not have to write the code for associating a goal with an event. It can be used with an after event so that the goal will be executed when the after event is raised. This predicate has to be imported to be used.

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(5) Type error
Event is not an atom.

Examples


:- import make_after_goal/2.

monitor(Var) :-
     make_after_goal(monvar, m(Var)),
     event_after_every(monvar, 1).

:- demon m/1.
m(Var) :- writeln(Var).


See Also

event_after / 2, event_after_every / 2, event / 1, set_event_handler / 2, current_after_event / 1, cancel_after_event / 1