exit - exit the program
(import (rnrs)) ;R6RS
(import (rnrs programs)) ;R6RS
(import (scheme process-context)) ;R7RS
Exits the running program and communicates an exit value to the
operating system. If no argument is supplied, the
procedure should communicate to the operating system that the program
exited normally. If an argument is supplied, the
procedure should translate the argument into an appropriate exit value
for the operating system.
the exit is assumed to be abnormal.
Runs all outstanding dynamic-wind
procedures, terminates the running program, and communicates an exit
value to the operating system.
is the same as
The exit procedure must not signal an exception or return to its
Because of the requirement to run handlers, this procedure is not just
the operating system's exit procedure.
Most implementations return
immediately to the operating system if it is a number between 0 and
- GNU Guile, Chez Scheme
These implementations run the dynamic-wind
This procedure does not return.
(exit) ;no return
This procedure should be avoided in libraries. Applications mainly use
it to return errors to the operating system, indicating to the shell
that the command has failed to execute correctly or indicating to the
init system that the service has failed.
R6RS does not explicitly say that the dynamic-wind exit handlers
should run. Some implementations run them and some do not.
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
The wrong number of arguments was passed.
The assertions described above are errors.
Implementations may signal an error, extend the procedure's
domain of definition to include such arguments,
or fail catastrophically.
This procedure first appeared in R6RS and later appeared in R7RS as
well. MacLISP had a
function with similar functionality.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Markup created by unroff 1.0sc, March 04, 2023.