{"size": 1522, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/scribblings/reference/exit.scrbl", "max_stars_repo_name": "lkh01/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "pkgs/racket-doc/scribblings/reference/exit.scrbl", "max_issues_repo_name": "lkh01/racket", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "pkgs/racket-doc/scribblings/reference/exit.scrbl", "max_forks_repo_name": "lkh01/racket", "max_forks_repo_forks_event_min_datetime": "2016-04-25T11:47:57.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-09T14:52:48.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 3, "avg_line_length": 38.05, "max_line_length": 77, "alphanum_fraction": 0.7562417871}
#lang scribble/doc
@(require "mz.rkt")

@title{Exiting}

@defproc[(exit [v any/c #t]) any]{

Passes @racket[v] to the current @tech{exit handler}. If the exit
handler does not escape or terminate the thread, @|void-const| is
returned.}


@defparam[exit-handler proc (any/c . -> . any)]{

A @tech{parameter} that determines the current @deftech{exit handler}. The
@tech{exit handler} is called by @racket[exit].

The default @tech{exit handler} in the Racket executable
takes any argument, calls @racket[plumber-flush-all] on the original plumber,
and shuts down the OS-level Racket process. The
argument is used as the OS-level exit code if it is an exact integer
between @racket[1] and @racket[255] (which normally means
``failure''); otherwise, the exit code is @racket[0], (which normally
means ``success'').}


@defparam[executable-yield-handler proc (byte? . -> . any)]{

A @tech{parameter} that determines a procedure to be called as the Racket
process is about to exit normally. The procedure associated with this
parameter is not called when @racket[exit] (or, more precisely, the
default @tech{exit handler}) is used to exit early. The argument to
the handler is the status code that is returned to the system on exit.
The default executable-yield handler simply returns @|void-const|.

The @racketmodname[scheme/gui/base] library sets this parameter to
wait until all frames are closed, timers stopped, and queued events
handled in the main eventspace. See @racketmodname[scheme/gui/base]
for more information.}
