summaryrefslogtreecommitdiff
path: root/elisp/geiser-racket.el
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 /elisp/geiser-racket.el
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.
Diffstat (limited to 'elisp/geiser-racket.el')
-rw-r--r--elisp/geiser-racket.el19
1 files changed, 13 insertions, 6 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 +\\([^ ]+\\)")