mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-01 15:20:34 +02:00
use guile eval for elisp tree-il
(Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (eval): Update with simplified definition. * module/language/elisp/compile-tree-il.scm: Import "(language tree-il eval)". (eval-when-compile): Use eval-elisp. (defmacro): Use eval-tree-il. * module/language/elisp/runtime.scm: Import "(language tree-il eval)". (eval-elisp): Use "eval" to evaluate compiled form within current-module.
This commit is contained in:
parent
7bfd2ba132
commit
02bb985c98
3 changed files with 6 additions and 9 deletions
|
@ -209,12 +209,7 @@
|
|||
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
|
||||
|
|
|
@ -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
|
||||
|
@ -462,7 +463,7 @@
|
|||
(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))
|
||||
|
||||
|
@ -786,7 +787,7 @@
|
|||
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))))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -247,7 +248,7 @@
|
|||
(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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue