only use tree-il evaluator for elisp
authorRobin Templeton <robin@terpri.org>
Mon, 18 Aug 2014 08:01:39 +0000 (04:01 -0400)
committerRobin Templeton <robin@terpri.org>
Fri, 13 Feb 2015 00:18:54 +0000 (19:18 -0500)
module/language/elisp/boot.el
module/language/elisp/compile-tree-il.scm
module/language/elisp/runtime.scm
module/language/tree-il/eval.scm
module/language/tree-il/spec.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..0bd1c3a 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-tree-il (compile form #:from 'elisp #:to 'tree-il)))
 
 (define (compile-elisp form)
   (compile (compile form #:from 'elisp #:to 'bytecode)
index cdc1c99..1c29dd1 100644 (file)
@@ -6,7 +6,7 @@
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 format)
-  #:export (compile-value))
+  #:export (eval-tree-il))
 
 (define guile-module (resolve-module '(guile)))
 
             (eval1 tag e)
             (append (map (cut eval1 <> e) args) (eval1 tail e))))))
 
-(define (compile-value x e opts)
-  (values (eval1 x '()) e e))
+(define (eval-tree-il x)
+  (eval1 x '()))
index 6c72b26..a7d1696 100644 (file)
@@ -23,7 +23,6 @@
   #:use-module (system base pmatch)
   #:use-module (language tree-il)
   #:use-module (language tree-il compile-cps)
-  #:use-module (language tree-il eval)
   #:export (tree-il))
 
 (define (write-tree-il exp . port)
@@ -43,7 +42,6 @@
   #:printer    write-tree-il
   #:parser      parse-tree-il
   #:joiner      join
-  #:compilers   `((value . ,compile-value)
-                  (cps . ,compile-cps))
+  #:compilers   `((cps . ,compile-cps))
   #:for-humans? #f
   )