summaryrefslogtreecommitdiff
path: root/elisp/geiser-eval.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-22 22:43:28 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-22 22:43:28 +0200
commitac2066b6f439b2497e761fbd99c9675db0b03bbd (patch)
tree0370d7256ca125510dba4b5912220a7d064fb702 /elisp/geiser-eval.el
parent8588781981a686dbd921c377fa9887bcd74728af (diff)
downloadgeiser-chez-ac2066b6f439b2497e761fbd99c9675db0b03bbd.tar.gz
geiser-chez-ac2066b6f439b2497e761fbd99c9675db0b03bbd.tar.bz2
New implementation registration mechanism, for the elisp side of things.
Implementations must invoke define-geiser-implementation with an appropriate set of methods. Simple inheritance is supported. Each geiser module defines and registers the method names it uses.
Diffstat (limited to 'elisp/geiser-eval.el')
-rw-r--r--elisp/geiser-eval.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el
index 5c84a57..c7b7d2c 100644
--- a/elisp/geiser-eval.el
+++ b/elisp/geiser-eval.el
@@ -14,6 +14,7 @@
+(require 'geiser-impl)
(require 'geiser-connection)
(require 'geiser-syntax)
(require 'geiser-log)
@@ -22,20 +23,26 @@
;;; Plug-able functions:
-(make-variable-buffer-local
- (defvar geiser-eval--get-module-function nil
- "Function used to obtain the module for current buffer. It
-takes an optional argument, for cases where we want to force its value."))
+(defvar geiser-eval--get-module-function nil)
+
+(geiser-impl--register-local-method
+ 'geiser-eval--get-module-function 'find-module '(lambda (&rest) nil)
+ "Function used to obtain the module for current buffer. It takes
+an optional argument, for cases where we want to force its
+value.")
(defsubst geiser-eval--get-module (&optional module)
(and geiser-eval--get-module-function
(funcall geiser-eval--get-module-function module)))
-(make-variable-buffer-local
- (defvar geiser-eval--geiser-procedure-function nil
- "Translate a bare procedure symbol to one executable in Guile's
-context. Return NULL for unsupported ones; at the very least,
-EVAL, COMPILE, LOAD-FILE and COMPILE-FILE should be supported."))
+(defvar geiser-eval--geiser-procedure-function nil)
+
+(geiser-impl--register-local-method
+ 'geiser-eval--geiser-procedure-function 'marshall-procedure 'identity
+ "Function to translate a bare procedure symbol to one executable
+in the Scheme context. Return NULL for unsupported ones; at the
+very least, EVAL, COMPILE, LOAD-FILE and COMPILE-FILE should be
+supported.")
(defsubst geiser-eval--form (proc)
(funcall geiser-eval--geiser-procedure-function proc))