add support for firing up a REPL to poke at DrRacket

This commit is contained in:
Robby Findler 2013-04-05 22:37:44 -05:00
parent 0ea2b61857
commit b05767ab13
2 changed files with 26 additions and 0 deletions

View File

@ -6,6 +6,8 @@
(define first-parallel? (getenv "PLTDRPAR"))
(define repl (getenv "PLTDRREPL"))
(define install-cm? (and (not debugging?)
(getenv "PLTDRCM")))
@ -149,3 +151,14 @@
((dynamic-require 'drracket/private/profile-drs 'start-profile) orig-cust)))
(dynamic-require 'drracket/private/drracket-normal #f)
(when repl
(printf "Welcome to DrRacket, v~a\n" (version))
(namespace-require 'racket)
(namespace-require 'drracket/tool-lib)
(unless (equal? repl "-q")
(define init-file (find-system-path 'init-file))
(when (file-exists? init-file)
(load init-file)))
(void (thread read-eval-print-loop)))

View File

@ -120,6 +120,19 @@ Several environment variables can affect DrRacket's behavior:
those collections are loaded (The contents of the environment
variable are @racket[read] and expected to be a single symbol
or a list of symbols).}
@item{@indexed-envvar{PLTDRREPL} : When this environment variable is
set, DrRacket starts a read-eval-print loop with all of
the forms and functions from the @racketmodname[racket]
module and those described in @other-doc['(lib "scribblings/tools/tools.scrbl")].
If it is not set to @litchar{-q}, then @racket[(find-system-path 'init-file)]
is loaded as well.
A new thread is created to evaluate REPL expressions, so be
sure to use @racket[queue-callback] to evaluate expressions
that mutate the GUI (to avoid race-conditions).
}
@item{@indexed-envvar{PLTDRCM} : When this environment variable is
set, DrRacket installs the compilation manager before starting