<commit_before>#lang scribble/doc
@(require scribble/manual
          "common.ss"
          (for-label scheme/base
                     scheme/unit
                     scheme/contract
                     launcher/launcher
                     launcher/launcher-sig
                     launcher/launcher-unit
                     compiler/embed
                     scheme/gui/base))

@title[#:tag "launcher"]{Installation-Specific Launchers for Scheme Code}

@defmodule[launcher/launcher]

The @schememodname[launcher/launcher] library provides functions for
creating @defterm{launchers}, which are similar to stand-alone
executables, but sometimes smaller because they depend permanently on
the local PLT Scheme installation. In the case of Unix, in particular,
a launcher is simply a shell script. The @|mzc| tool provides no
direct support for creating launchers.

@section{Creating Launchers}

@defproc[(make-mred-launcher [args (listof string?)]
                             [dest path-string?]
                             [aux (listof (cons/c symbol? any/c)) null])
         void?]{

Creates the launcher @scheme[dest], which starts MrEd with the
command-line arguments specified as strings in @scheme[args]. Extra
arguments passed to the launcher at run-time are appended (modulo
special Unix/X flag handling, as described below) to this list and
passed on to MrEd. If @scheme[dest] exists already, as either a file
or directory, it is replaced.

The optional @scheme[aux] argument is an association list for
platform-specific options (i.e., it is a list of pairs where the first
element of the pair is a key symbol and the second element is the
value for that key). See also @scheme[build-aux-from-path]. See
@scheme[create-embedding-executable] for a list that applies to both
stand-alone executables and launchers under Windows and Mac OS X MrEd;
the following additional associations apply to launchers:

@itemize{

 @item{@scheme['independent?] (Windows) --- a boolean; @scheme[#t]
       creates an old-style launcher that is independent of the
       MzScheme or MrEd binary, like @exec{setup-plt.exe}. No other
       @scheme[aux] associations are used for an old-style launcher.}

 @item{@scheme['exe-name] (Mac OS X, @scheme['script-3m] or
       @scheme['script-cgc] variant) --- provides the base name for a
       @scheme['3m]-/@scheme['cgc]-variant launcher, which the script
       will call ignoring @scheme[args]. If this name is not provided,
       the script will goes through the MrEd executable as usual.}

 @item{@scheme['relative?] (all platforms) --- a boolean, where
        @scheme[#t] means that the generated launcher should find the
        base MrEd executable through a relative path.}

}

For Unix/X, the script created by @scheme[make-mred-launcher] detects
and handles X Windows flags specially when they appear as the initial
arguments to the script. Instead of appending these arguments to the
end of @scheme[args], they are spliced in after any X Windows flags
already listed listed in @scheme[args]. The remaining arguments (i.e.,
all script flags and arguments after the last X Windows flag or
argument) are then appended after the spliced @scheme[args].}


@defproc[(make-mzscheme-launcher [args (listof string?)]
                                 [dest path-string?]
                                 [aux (listof (cons/c symbol? any/c)) null])
         void?]{

Like @scheme[make-mred-launcher], but for starting MzScheme. Under Mac
OS X, the @scheme['exe-name] @scheme[aux] association is ignored.}


@defproc[(make-mred-program-launcher [file string?]<commit_msg>typo<commit_after>#lang scribble/doc
@(require scribble/manual
          "common.ss"
          (for-label scheme/base
                     scheme/unit
                     scheme/contract
                     launcher/launcher
                     launcher/launcher-sig
                     launcher/launcher-unit
                     compiler/embed
                     scheme/gui/base))

@title[#:tag "launcher"]{Installation-Specific Launchers for Scheme Code}

@defmodule[launcher/launcher]

The @schememodname[launcher/launcher] library provides functions for
creating @defterm{launchers}, which are similar to stand-alone
executables, but sometimes smaller because they depend permanently on
the local PLT Scheme installation. In the case of Unix, in particular,
a launcher is simply a shell script. The @|mzc| tool provides no
direct support for creating launchers.

@section{Creating Launchers}

@defproc[(make-mred-launcher [args (listof string?)]
                             [dest path-string?]
                             [aux (listof (cons/c symbol? any/c)) null])
         void?]{

Creates the launcher @scheme[dest], which starts MrEd with the
command-line arguments specified as strings in @scheme[args]. Extra
arguments passed to the launcher at run-time are appended (modulo
special Unix/X flag handling, as described below) to this list and
passed on to MrEd. If @scheme[dest] exists already, as either a file
or directory, it is replaced.

The optional @scheme[aux] argument is an association list for
platform-specific options (i.e., it is a list of pairs where the first
element of the pair is a key symbol and the second element is the
value for that key). See also @scheme[build-aux-from-path]. See
@scheme[create-embedding-executable] for a list that applies to both
stand-alone executables and launchers under Windows and Mac OS X MrEd;
the following additional associations apply to launchers:

@itemize{

 @item{@scheme['independent?] (Windows) --- a boolean; @scheme[#t]
       creates an old-style launcher that is independent of the
       MzScheme or MrEd binary, like @exec{setup-plt.exe}. No other
       @scheme[aux] associations are used for an old-style launcher.}

 @item{@scheme['exe-name] (Mac OS X, @scheme['script-3m] or
       @scheme['script-cgc] variant) --- provides the base name for a
       @scheme['3m]-/@scheme['cgc]-variant launcher, which the script
       will call ignoring @scheme[args]. If this name is not provided,
       the script will go through the MrEd executable as usual.}

 @item{@scheme['relative?] (all platforms) --- a boolean, where
        @scheme[#t] means that the generated launcher should find the
        base MrEd executable through a relative path.}

}

For Unix/X, the script created by @scheme[make-mred-launcher] detects
and handles X Windows flags specially when they appear as the initial
arguments to the script. Instead of appending these arguments to the
end of @scheme[args], they are spliced in after any X Windows flags
already listed listed in @scheme[args]. The remaining arguments (i.e.,
all script flags and arguments after the last X Windows flag or
argument) are then appended after the spliced @scheme[args].}


@defproc[(make-mzscheme-launcher [args (listof string?)]
                                 [dest path-string?]
                                 [aux (listof (cons/c symbol? any/c)) null])
         void?]{

Like @scheme[make-mred-launcher], but for starting MzScheme. Under Mac
OS X, the @scheme['exe-name] @scheme[aux] association is ignored.}


@defproc[(make-mred-program-launcher [file string?]
{'fraction_non_alphanumeric': 0.08556001661359545, 'fraction_numerical': 0.0005537865152983525, 'mean_word_length': 3.0380100614868644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7472739', 'n_tokens_mistral': 2019, 'n_tokens_neox': 1920, 'n_words': 813}