use guile eval for elisp tree-il
authorRobin Templeton <robin@terpri.org>
Mon, 18 Aug 2014 08:01:39 +0000 (04:01 -0400)
committerRobin Templeton <robin@terpri.org>
Tue, 21 Apr 2015 23:36:30 +0000 (19:36 -0400)
module/language/elisp/boot.el
module/language/elisp/compile-tree-il.scm
module/language/elisp/runtime.scm

index e6d3994..27af815 100644 (file)
       f)))
 
 (defun eval (form)
-  (%funcall (@ (system base compile) compile)
-            form
-            (%funcall (@ (guile) symbol->keyword) 'from)
-            'elisp
-            (%funcall (@ (guile) symbol->keyword) 'to)
-            'value))
+  (%funcall (@ (language elisp runtime) eval-elisp) form))
 
 (defun %indirect-function (object)
   (cond
index 9f2b10c..3e4f74b 100644 (file)
@@ -30,6 +30,7 @@
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 format)
+  #:use-module (language tree-il eval)
   #:export (compile-tree-il
             compile-progn
             compile-eval-when-compile
                  (map compile-expr-1 args))))
 
 (defspecial eval-when-compile (loc args)
-  (make-const loc (compile `(progn ,@args) #:from 'elisp #:to 'value)))
+  (make-const loc (eval-elisp `(progn ,@args))))
 
 (define toplevel? (make-fluid))
 
                                           body))))
                   (make-const loc name))))
            (when (fluid-ref toplevel?)
-             (compile tree-il #:from 'tree-il #:to 'value))
+             (eval-tree-il tree-il))
            tree-il)))
     (else (report-error loc "bad defmacro" args))))
 
index d6d4f70..c8c39bf 100644 (file)
@@ -22,6 +22,7 @@
   #:use-module (ice-9 format)
   #:use-module ((system base compile)
                 #:select (compile))
+  #:use-module (language tree-il eval)
   #:export (nil-value
             t-value
             value-slot-module
   (set! set-lexical-binding-mode (lambda (x) (set-symbol-value! 'lexical-binding x))))
 
 (define (eval-elisp form)
-  (compile form #:from 'elisp #:to 'value))
+  (eval (compile form #:from 'elisp #:to 'tree-il) (current-module)))
 
 (define (compile-elisp form)
   (compile (compile form #:from 'elisp #:to 'bytecode)