Pristine Ack-5.5
[Ack-5.5.git] / lang / m2 / libm2 / Epilogue.def
1 (*$Foreign*)
2 DEFINITION MODULE Epilogue;
3 (*
4   Module:       install module termination procedures to be called at
5                 program termination
6   Author:       Ceriel J.H. Jacobs
7   Version:      $Id: Epilogue.def,v 1.5 1994/06/24 12:48:42 ceriel Exp $
8
9    MODULA-2 offers a facility for the initialization of modules, but there
10    is no mechanism to have some code executed when the program finishes.
11    This module is a feeble attempt at solving this problem.
12 *)
13   PROCEDURE CallAtEnd(p: PROC): BOOLEAN;
14   (* Add procedure "p" to the list of procedures that must be executed when
15      the program finishes.
16      When the program finishes, these procedures are executed in the REVERSE
17      order in which they were added to the list.
18      This procedure returns FALSE when there are too many procedures to be 
19      called (the list has a fixed size).
20   *)
21 END Epilogue.