diff options
author | jao <jao@gnu.org> | 2022-10-27 02:34:08 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-10-27 02:34:08 +0100 |
commit | af47e12809629239bdf7a660a7fe326159a50cf8 (patch) | |
tree | 919544a2dc5f908cb983a46a53d4bb602d5e75ce | |
parent | 3ad1c3807c25283bb344512b3be3da197200ba3a (diff) | |
download | geiser-chez-af47e12809629239bdf7a660a7fe326159a50cf8.tar.gz geiser-chez-af47e12809629239bdf7a660a7fe326159a50cf8.tar.bz2 |
fix: don't pollute global namespace with (geiser)'s exports
-rw-r--r-- | geiser-chez.el | 19 | ||||
-rw-r--r-- | src/geiser/geiser.ss | 5 |
2 files changed, 14 insertions, 10 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 () diff --git a/src/geiser/geiser.ss b/src/geiser/geiser.ss index 0af9807..aeb719e 100644 --- a/src/geiser/geiser.ss +++ b/src/geiser/geiser.ss @@ -22,7 +22,8 @@ geiser:symbol-location geiser:module-location geiser:add-to-load-path - geiser:symbol-documentation) + geiser:symbol-documentation + quote) (import (chezscheme)) (import (geiser-data)) @@ -201,7 +202,7 @@ (define (geiser:ge:eval lib form) (parameterize ([current-library lib]) - (call-with-result (lambda () (eval form))))) + (call-with-result (lambda () (eval form (environment '(geiser))))))) (define (geiser:completions prefix) (sort string-ci<? |