diff --git a/pkgs/racket-doc/scribblings/reference/repl.scrbl b/pkgs/racket-doc/scribblings/reference/repl.scrbl new file mode 100644 index 0000000000..79046cd4dc --- /dev/null +++ b/pkgs/racket-doc/scribblings/reference/repl.scrbl @@ -0,0 +1,12 @@ +#lang scribble/doc +@(require "mz.rkt") + +@title[#:tag "repl-module"]{The @racketmodname[racket/repl] Library} + +@defmodule[racket/repl] + +The @racketmodname[racket/repl] provides the same +@racket[read-eval-print-loop] binding as @racketmodname[racket/base], but +with even fewer internal dependencies than @racketmodname[racket/base]. It is +loaded in some situations on startup, as described in +@secref["init-actions"]. diff --git a/pkgs/racket-doc/scribblings/reference/security.scrbl b/pkgs/racket-doc/scribblings/reference/security.scrbl index 5f14a7a306..96bfbc91b6 100644 --- a/pkgs/racket-doc/scribblings/reference/security.scrbl +++ b/pkgs/racket-doc/scribblings/reference/security.scrbl @@ -18,4 +18,5 @@ @include-section["code-inspectors.scrbl"] @include-section["plumbers.scrbl"] @include-section["sandbox.scrbl"] +@include-section["repl.scrbl"] @include-section["linklet.scrbl"] diff --git a/pkgs/racket-doc/scribblings/reference/startup.scrbl b/pkgs/racket-doc/scribblings/reference/startup.scrbl index dfb3adf6f5..8b76810eaf 100644 --- a/pkgs/racket-doc/scribblings/reference/startup.scrbl +++ b/pkgs/racket-doc/scribblings/reference/startup.scrbl @@ -80,20 +80,26 @@ submodule of the required module or the language is used before the module is instantiated; see @secref["configure-runtime"]. -After running all command-line expressions, files, and modules, -Racket or GRacket then starts a read-eval-print loop for interactive +After running all command-line expressions, files, and modules, Racket +or GRacket then starts a read-eval-print loop for interactive evaluation if no command line flags are provided other than -@tech{configuration options}. If any command-line argument is +@tech{configuration options}. For Racket, the read-eval-print loop is +run by calling @racket[read-eval-print-loop] from +@racketmodname[racket/repl]. For GRacket, the read-eval-print loop is +run by calling @racket[graphical-read-eval-print-loop] from +@racketmodname[racket/gui/base]. If any command-line argument is provided that is not a @tech{configuration option}, then the read-eval-print-loop is not started, unless the @Flag{i}/@DFlag{repl} flag is provided on the command line to -specifically re-enable it. In addition, just before the command line +specifically re-enable it. + +In addition, just before the read-eval-print loop is started, Racket runs @racketmodname[racket/interactive] and GRacket runs @racketmodname[racket/gui/interactive], unless a different interactive file is specified in the the installation's @filepath{config.rktd} file found in @racket[(find-config-dir)], or the file @filepath{interactive.rkt} is found in @racket[(find-system-path 'addon-dir)]. If the -@Flag{q}/@DFlag{no-init-file} flag is specified on the command line +@Flag{q}/@DFlag{no-init-file} flag is specified on the command line, then no interactive file is run. Finally, before Racket or GRacket exits, it calls the procedure that @@ -103,7 +109,10 @@ specified. Requiring @racketmodname[racket/gui/base] sets this parameter call @racket[(racket 'yield)]. @history[#:changed "6.7" @elem{Run @racketmodname[racket/interactive] file - rather than directly running @racket[(find-system-path 'init-file)].}] + rather than directly running @racket[(find-system-path 'init-file)].} + #:changed "6.90.0.30" @elem{Run a read-eval-print loop by + using @racketmodname[racket/repl] or @racketmodname[racket/gui/base] + instead of @racketmodname[racket/base] or @racketmodname[racket/gui/init].}] @; ---------------------------------------------------------------------- diff --git a/racket/collects/racket/private/misc.rkt b/racket/collects/racket/private/misc.rkt index 50fbadbfd5..756a8c5941 100644 --- a/racket/collects/racket/private/misc.rkt +++ b/racket/collects/racket/private/misc.rkt @@ -5,7 +5,7 @@ (module misc '#%kernel (#%require "small-scheme.rkt" "define.rkt" "path.rkt" "old-path.rkt" "path-list.rkt" "executable-path.rkt" - "reading-param.rkt" "repl.rkt" + "reading-param.rkt" "../repl.rkt" (for-syntax '#%kernel "qq-and-or.rkt" "stx.rkt" "stxcase-scheme.rkt" "stxcase.rkt")) ;; ------------------------------------------------------------------------- diff --git a/racket/collects/racket/private/repl.rkt b/racket/collects/racket/repl.rkt similarity index 100% rename from racket/collects/racket/private/repl.rkt rename to racket/collects/racket/repl.rkt diff --git a/racket/src/racket/main.c b/racket/src/racket/main.c index a6af61f9b7..0be8e3f8a5 100644 --- a/racket/src/racket/main.c +++ b/racket/src/racket/main.c @@ -482,13 +482,13 @@ static void do_scheme_rep(Scheme_Env *env, FinishArgs *fa) #ifdef GRAPHICAL_REPL if (!fa->a->alternate_rep) { - a[0] = scheme_intern_symbol("racket/gui/init"); + a[0] = scheme_intern_symbol("racket/gui/base"); a[1] = scheme_intern_symbol("graphical-read-eval-print-loop"); ending_newline = 0; } else #endif { - a[0] = scheme_intern_symbol("racket/base"); + a[0] = scheme_intern_symbol("racket/repl"); a[1] = scheme_intern_symbol("read-eval-print-loop"); }