diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-17 00:44:11 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-17 00:44:11 +0100 |
commit | 6e89d965f1b0a8329ddc012feb36fd43c591acbf (patch) | |
tree | fe01c5fd6bc286dc3f360ec5a90338619a5f6c1d /elisp/geiser-eval.el | |
parent | 41d54012368ca33461fe3e8668c2b0e3052af3b8 (diff) | |
download | geiser-chez-6e89d965f1b0a8329ddc012feb36fd43c591acbf.tar.gz geiser-chez-6e89d965f1b0a8329ddc012feb36fd43c591acbf.tar.bz2 |
Separate commands for evaluation and compilation.
Diffstat (limited to 'elisp/geiser-eval.el')
-rw-r--r-- | elisp/geiser-eval.el | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index b1bd83b..4566d0b 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -38,22 +38,30 @@ ((eq code :f) "#f") ((eq code :t) "#t") ((listp code) - (cond ((eq (car code) :gs) (geiser-eval--gs (cdr code))) + (cond ((eq (car code) :eval) (geiser-eval--eval (cdr code))) + ((eq (car code) :comp) (geiser-eval--comp (cdr code))) + ((eq (car code) :module) (geiser-eval--module (cadr code))) ((eq (car code) :ge) (geiser-eval--ge (cadr code))) ((eq (car code) :scm) (cadr code)) (t (concat "(" (mapconcat 'geiser-eval--scheme-str code " ") ")")))) ((symbolp code) (format "%s" code)) (t (format "%S" code)))) -(defsubst geiser-eval--gs (code) - (concat "((@ (geiser eval) eval-in) (quote " - (geiser-eval--scheme-str (nth 0 code)) - ") (quote " - (or (and (nth 1 code) - (geiser-eval--scheme-str (nth 1 code))) - (geiser-syntax--buffer-module) - "#f") - "))")) +(defsubst geiser-eval--eval (code) + (geiser-eval--scheme-str + `((@ (geiser eval) eval-in) (quote ,(nth 0 code)) (:module ,(nth 1 code))))) + +(defsubst geiser-eval--comp (code) + (geiser-eval--scheme-str + `((@ (geiser eval) compile-in) (quote ,(nth 0 code)) (:module ,(nth 1 code))))) + +(defsubst geiser-eval--module (code) + (geiser-eval--scheme-str + (cond ((or (eq code '(())) (null code)) + `(quote ,(or (geiser-syntax--buffer-module) :f))) + ((listp code) `(quote ,code)) + ((stringp code) (:scm code)) + (t (error "Invalid module spec: %S" code))))) (defsubst geiser-eval--ge (proc) (format "(@ (geiser emacs) ge:%s)" proc)) |