diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-06 21:42:09 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-06 21:42:09 +0100 |
commit | 2aad392f96e8fdf6040c3761171045e25fb0a8c9 (patch) | |
tree | 93b87ab51faeaa35300b45e7a2cc69b027a8bbf8 /scheme/racket/geiser/user.rkt | |
parent | f972d32e556e305936e4aa9f1249fe2846e07a20 (diff) | |
download | geiser-guile-2aad392f96e8fdf6040c3761171045e25fb0a8c9.tar.gz geiser-guile-2aad392f96e8fdf6040c3761171045e25fb0a8c9.tar.bz2 |
Racket: little evaluation nits
Diffstat (limited to 'scheme/racket/geiser/user.rkt')
-rw-r--r-- | scheme/racket/geiser/user.rkt | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/scheme/racket/geiser/user.rkt b/scheme/racket/geiser/user.rkt index 20f8a00..88cc24c 100644 --- a/scheme/racket/geiser/user.rkt +++ b/scheme/racket/geiser/user.rkt @@ -11,7 +11,7 @@ #lang racket/base -(provide enter!) +(provide init-geiser-repl run-geiser-repl enter!) (require geiser/main geiser/enter geiser/eval (for-syntax racket/base)) @@ -29,6 +29,7 @@ mod)))) (define orig-loader (current-load/use-compiled)) +(define geiser-loader (module-loader orig-loader)) (define orig-reader (current-prompt-read)) @@ -56,10 +57,19 @@ (else form))) (_ form)))) -(define (init) +(define geiser-prompt-read + (compose (make-repl-reader geiser-read) current-namespace)) + +(define (init-geiser-repl) (compile-enforce-module-constants #f) - (current-load/use-compiled (module-loader orig-loader)) - (current-prompt-read - (compose (make-repl-reader geiser-read) current-namespace))) + (current-load/use-compiled geiser-loader) + (current-prompt-read geiser-prompt-read)) -(init) +(define (run-geiser-repl in out (enforce-module-constants #f)) + (parameterize [(compile-enforce-module-constants enforce-module-constants) + (current-input-port in) + (current-output-port out) + (current-error-port out) + (current-load/use-compiled geiser-loader) + (current-prompt-read geiser-prompt-read)] + (read-eval-print-loop))) |