Standard ML of New Jersey

The CLEAN_UP signature


signature CLEAN_UP

This modules provides hooks for actions (e.g., closing files) to be performed at various important points in the ML process, such as at process exit.


datatype when  = AtExportML  | AtExportFn  | AtExit  | AtInit  | AtInitFn
val atAll : when list
val addCleaner : (string * when list * (when -> unit)) -> (when list * (when -> unit)) option
val removeCleaner : string -> (when list * (when -> unit)) option
val clean : when -> unit


datatype when
The event that occurs when SMLofNJ.exportML is called.

The event that occurs when SMLofNJ.exportFn is called.

The event that occurs when the ML process exits.

The event that occurs when a heap image created by SMLofNJ.exportML begins executing.

The event that occurs when a heap image created by SMLofNJ.exportFn begins executing.

A list containing all the when values.

addCleaner (name, when, f)
Install a new cleaner f with name name. From now on, whenever an event w in the when list occurs, f(w) will be called. If there was previously a cleaner (when',g) associated with that name, then SOME(when',g) will be removed and returned, otherwise NONE.

removeCleaner name
Remove and return any cleaner associated with name, or return NONE.

clean when
Execute all cleaners executed with event when. This function is automatically called by the system at the appropriate times, but may also be called by the user.

[ Top | Parent | Contents | Index | Root ]

Last Modified October 28, 1997
Comments to
Copyright © 1998 Bell Labs, Lucent Technologies