31.1. Customizing CLISP Process Initialization and Termination

31.1.1. Cradle to Grave
31.1.2. Customizing Initialization
31.1.2.1. The difference between CUSTOM:*INIT-HOOKS* and init function
31.1.3. Customizing Termination

31.1.1. Cradle to Grave

What is done when

  1. Initialization

    1. Parse command line arguments until the first positional argument (see :SCRIPT).

    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.

31.1.2. Customizing Initialization

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

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

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

31.1.3. Customizing Termination

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

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

These notes document CLISP version 2.49.93+Last modified: 2018-02-19