[ Obsolete | Reference Manual | Alphabetic Index ]

suspension_to_goal(+Susp, -Goal, -Module)

Succeeds for an unwoken suspension and returns the corresponding Goal structure and caller module.
A suspension.
A variable or a callable term.
A variable or a module.

This built-in predicate is obsolete!


This built-in is used to access the contents of the abstract suspension data type. It is complementary to make_suspension/3 as it returns the original goal structure and the module where make_suspension/3 was executed. If applied to an already woken suspension it fails.

Note that a suspension is not a standard Prolog data structure and can only be manipulated in a restricted way. In particular, a suspension is not a term an atom of the form 'SUSP-...', although it is printed this way by default. suspension_to_goal/3 is the only way to access the contents of a suspension.

Modes and Determinism

Fail Conditions

Fails if the suspension is already dead


(4) instantiation fault
Susp is not instantiated.
(5) type error
Susp is not a suspension.
(5) type error
Goal is neither variable nor a callable term.
(5) type error
Module is neither variable nor atom.


[eclipse 1]: make_suspension(writeln(hello), 0, S),
        suspension_to_goal(S, Goal, Module).
S = 'SUSP-_303-susp'
Goal = writeln(hello)
Module = eclipse
Delayed goals:
[eclipse 2]: make_suspension(writeln(hello), 0, S),
        suspension_to_goal(S, Goal, Module).

no (more) solution.

See Also

get_suspension_data / 3, delayed_goals / 1, kill_suspension / 1, make_suspension / 3