Ignore:
Timestamp:
11/22/17 21:03:52 (4 years ago)
Author:
sjamaan
Message:

man/5: Move the "exit" family of procedures from (chicken process-context) to (chicken base)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/man/5/Module (chicken process-context)

    r34492 r34904  
    4040{{(car (argv))}} for compiled programs or the filename following the
    4141{{-script}} option in interpreted scripts.
    42 
    43 
    44 
    45 === Process shutdown
    46 
    47 ==== emergency-exit
    48 
    49 <procedure>(emergency-exit [CODE])</procedure>
    50 
    51 Exits the current process without flushing any buffered output (using
    52 the C function {{_exit}}).  Note that the {{exit-handler}} is not called
    53 when this procedure is invoked. The optional exit status code {{CODE}}
    54 defaults to {{0}}.
    55 
    56 
    57 ==== exit
    58 
    59 <procedure>(exit [CODE])</procedure>
    60 
    61 Exit the running process and return exit-code, which defaults to 0
    62 (Invokes {{exit-handler}}).
    63 
    64 Note that pending {{dynamic-wind}} thunks are ''not'' invoked when exiting your program in this way.
    65 
    66 
    67 === exit-handler
    68 
    69 <parameter>(exit-handler)</parameter>
    70 
    71 A procedure of a single optional argument. When {{exit}} is called,
    72 then this procedure will be invoked with the exit-code as argument. The
    73 default behavior is to terminate the program.
    74 
    75 Note that this handler is ''not'' invoked when {{emergency-exit}} is
    76 used.
    77 
    78 
    79 === implicit-exit-handler
    80 
    81 <parameter>(implicit-exit-handler)</parameter>
    82 
    83 A procedure of no arguments. When the last toplevel expression of the
    84 program has executed, then the value of this parameter is called. The
    85 default behaviour is to invoke all pending finalizers.
    86 
    87 
    88 ==== on-exit
    89 
    90 <procedure>(on-exit THUNK)</procedure>
    91 
    92 Schedules the zero-argument procedures {{THUNK}} to be executed before
    93 the process exits, either explicitly via {{exit}} or implicitly after execution
    94 of the last top-level form. Note that finalizers for unreferenced finalized
    95 data are run before exit procedures.
    9642
    9743
Note: See TracChangeset for help on using the changeset viewer.