30.1. Customizing CLISP Process Initialization and Termination

30.1.1. Cradle to Grave
30.1.2. Customizing Initialization
30.1.2.1. The difference between CUSTOM:*INIT-HOOKS* and init function
30.1.3. Customizing Termination

30.1.1. Cradle to Grave

What is done when

  1. Initialization

    1. Parse command line arguments until the first positional argument (see :SCRIPT in Section 30.2, “Saving an Image”).

    2. Load the memory image.

    3. Install internal signal handlers.

    4. Initialize time variables.

    5. Initialize locale-dependent encodings.

    6. Initialize stream variables.

    7. Initialize pathname variables.

    8. Initialize FFI.

    9. Initialize modules.

    10. Run all functions in CUSTOM:*INIT-HOOKS*.

    11. Say “hi”, unless suppressed by -q.

    12. Load RC file, unless suppressed by -norc.

  2. The actual work

    Handle command line options: file loading and/or compilation, form evaluation, script execution, read-eval-print loop.

  3. Finalization (executed even on abnormal exit due to kill)

    1. Unwind the STACK, executing cleanup forms in UNWIND-PROTECT.

    2. Run all functions in CUSTOM:*FINI-HOOKS*.

    3. Call FRESH-LINE on the standard streams.

    4. Say “bye” unless suppressed by -q.

    5. Wait for a keypress if requested by -w.

    6. Close all open FILE-STREAMs.

    7. Finalize modules.

    8. Close all open DLLs.

30.1.2. Customizing Initialization

CUSTOM:*INIT-HOOKS* is run like this:

(MAPC #'FUNCALL CUSTOM:*INIT-HOOKS*)

30.1.2.1. The difference between CUSTOM:*INIT-HOOKS* and init function

30.1.3. Customizing Termination

CUSTOM:*FINI-HOOKS* is run like this:

(MAPC #'FUNCALL CUSTOM:*FINI-HOOKS*)

These notes document CLISP version 2.41Last modified: 2006-10-13