summaryrefslogtreecommitdiff
path: root/geiser-chez.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-10-27 02:34:08 +0100
committerjao <jao@gnu.org>2022-10-27 02:34:08 +0100
commitaf47e12809629239bdf7a660a7fe326159a50cf8 (patch)
tree919544a2dc5f908cb983a46a53d4bb602d5e75ce /geiser-chez.el
parent3ad1c3807c25283bb344512b3be3da197200ba3a (diff)
downloadgeiser-chez-af47e12809629239bdf7a660a7fe326159a50cf8.tar.gz
geiser-chez-af47e12809629239bdf7a660a7fe326159a50cf8.tar.bz2
fix: don't pollute global namespace with (geiser)'s exports
Diffstat (limited to 'geiser-chez.el')
-rw-r--r--geiser-chez.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/geiser-chez.el b/geiser-chez.el
index 1e847ef..8b7af24 100644
--- a/geiser-chez.el
+++ b/geiser-chez.el
@@ -122,24 +122,27 @@ Return its local name."
(defun geiser-chez--startup (_remote)
"Startup function."
- (let ((geiser-log-verbose-p t))
- (compilation-setup t)
- (geiser-eval--send/wait
- "(begin (import (geiser)) (write `((result ) (output . \"\"))) (newline))")))
+ t)
;;; Evaluation support
+(defsubst geiser-chez--geiser-eval (str)
+ (format "(eval '%s (environment '(geiser)))" str))
+
+(defconst geiser-chez--ge (geiser-chez--geiser-eval "geiser:ge:eval"))
+(defconst geiser-chez--ev (geiser-chez--geiser-eval "geiser:eval"))
+(defconst geiser-chez--load (geiser-chez--geiser-eval "geiser:load-file"))
+
(defun geiser-chez--geiser-procedure (proc &rest args)
"Transform PROC in string for a scheme procedure using ARGS."
(cl-case proc
((eval compile)
(if (listp (cadr args))
- (format "(geiser:ge:eval '%s '%s)" (car args) (cadr args))
- (format "(geiser:eval '%s '%s)" (car args) (cadr args))))
+ (format "(%s '%s '%s)" geiser-chez--ge (car args) (cadr args))
+ (format "(%s '%s '%s)" geiser-chez--ev (car args) (cadr args))))
((load-file compile-file)
(let ((lib (geiser-chez--current-library)))
- (format "(geiser:load-file %s '%s)" (car args) (or lib "#f"))))
- ((no-values) "(geiser:no-values)")
+ (format "(%s %s '%s)" geiser-chez--load (car args) (or lib "#f"))))
(t (list (format "geiser:%s" proc) (mapconcat 'identity args " ")))))
(defun geiser-chez--current-library ()