summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-10-30 05:02:43 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-10-30 05:02:43 +0200
commit19adb11523a6a1b87ae8dda7c1734db3ca476ddc (patch)
tree09a009437fc75863427b6f7f31662592468210ed
parent25efa35db669a3994fc1a4df7462633adfb6941d (diff)
downloadgeiser-chez-19adb11523a6a1b87ae8dda7c1734db3ca476ddc.tar.gz
geiser-chez-19adb11523a6a1b87ae8dda7c1734db3ca476ddc.tar.bz2
Racket: using meta-commands instead of dynamic-require (#30347)
- Much more robust: dynamic-require might not have been defined in the REPL's namespace. - Fixes #30347 as a side-effect: now all Geiser functions work with typed scheme too.
-rw-r--r--elisp/geiser-racket.el19
-rw-r--r--scheme/racket/geiser/eval.rkt6
2 files changed, 15 insertions, 10 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index f38a4e9..0150772 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -93,12 +93,19 @@ This function uses `geiser-racket-init-file' if it exists."
(if (re-search-forward
"^\\(?:#lang\\|(module +[^ ]+?\\) +\\([^ ]+?\\|([^)]+)\\) *$" nil t)
(car (geiser-syntax--read-from-string (match-string-no-properties 1)))
- :f)))
-
-(defun geiser-racket--geiser-procedure (proc)
- (if (memq proc '(eval compile))
- `((dynamic-require 'geiser 'geiser:eval) ',(geiser-racket--language))
- `(dynamic-require 'geiser ',(intern (format "geiser:%s" proc)))))
+ "#f")))
+
+(defun geiser-racket--geiser-procedure (proc &rest args)
+ (case proc
+ ((eval compile)
+ (format ",eval %s %s %s"
+ (or (car args) "#f")
+ (geiser-racket--language)
+ (mapconcat 'identity (cdr args) " ")))
+ ((load-file compile-file)
+ (format ",eval geiser/main racket (geiser:%s %s)" proc (car args)))
+ ((no-values) ",no-values")
+ (t (format ",apply geiser:%s (%s)" proc (mapconcat 'identity args " ")))))
(defconst geiser-racket--module-re
"^(module +\\([^ ]+\\)")
diff --git a/scheme/racket/geiser/eval.rkt b/scheme/racket/geiser/eval.rkt
index f2cf39f..4e7f3db 100644
--- a/scheme/racket/geiser/eval.rkt
+++ b/scheme/racket/geiser/eval.rkt
@@ -63,10 +63,8 @@
(define compile-in eval-in)
(define (load-file file)
- (call-with-result
- (lambda ()
- (load-module file (current-output-port) (last-namespace))
- (update-signature-cache file))))
+ (load-module file (current-output-port) (last-namespace))
+ (update-signature-cache file))
(define compile-file load-file)