2 DEFINITION MODULE Epilogue;
4 Module: install module termination procedures to be called at
6 Author: Ceriel J.H. Jacobs
7 Version: $Id: Epilogue.def,v 1.5 1994/06/24 12:48:42 ceriel Exp $
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.
13 PROCEDURE CallAtEnd(p: PROC): BOOLEAN;
14 (* Add procedure "p" to the list of procedures that must be executed when
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).