next up previous index
Next: The Standard suspend Attribute Up: Advanced Control Features Previous: More about Priorities   Index

Printing Suspensions

The default format for the printing of a sleeping suspension is 'SUSP-_nn-susp':
[eclipse 2]: make_suspension(help(X), 2, S).
S = 'SUSP-_78-susp'

Scheduled and executed suspensions are by default printed as follows:

[eclipse 6]: make_suspension(true, 2, S), writeln(S),
             schedule_woken([S]), writeln(S).
'SUSP-_88-susp'
'SUSP-_88-sched'
S = 'SUSP-_88-dead'

The way suspensions are printed can be changed by defining a write macro for the type goal:

[eclipse 1]: [user].
 :- op(1090, fx, <), op(1100, xf, >).
 trs(S, <Goal>) :-
        suspension_to_goal(S, Goal, _).
 :- define_macro(type(goal), trs/2, [write]).
^D
yes.
[eclipse 2]: make_suspension(writeln(hello), 2, S).

S = < writeln(hello) >



Warwick Harvey
2004-08-07