mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
rewrite eval' and
load' in elisp
* module/language/elisp/subrs.scm (eval, load): Rewrite in Elisp and move to... * module/language/elisp/boot.el (eval, load): ...here.
This commit is contained in:
parent
48489836e2
commit
5bcc6d9e70
2 changed files with 18 additions and 15 deletions
|
@ -117,12 +117,26 @@
|
||||||
#'(lambda () ,bodyform)
|
#'(lambda () ,bodyform)
|
||||||
#'(lambda () ,@unwindforms)))
|
#'(lambda () ,@unwindforms)))
|
||||||
|
|
||||||
(fset 'eval (@ (language elisp runtime subrs) eval))
|
|
||||||
(fset' load (@ (language elisp runtime subrs) load))
|
|
||||||
|
|
||||||
(defun throw (tag value)
|
(defun throw (tag value)
|
||||||
(funcall (@ (guile) throw) 'elisp-exception tag value))
|
(funcall (@ (guile) throw) 'elisp-exception tag value))
|
||||||
|
|
||||||
|
(defun eval (form)
|
||||||
|
(funcall (@ (system base compile) compile)
|
||||||
|
form
|
||||||
|
(funcall (@ (guile) symbol->keyword) 'from)
|
||||||
|
'elisp
|
||||||
|
(funcall (@ (guile) symbol->keyword) 'to)
|
||||||
|
'value))
|
||||||
|
|
||||||
|
(defun load (file)
|
||||||
|
(funcall (@ (system base compile) compile-file)
|
||||||
|
file
|
||||||
|
(funcall (@ (guile) symbol->keyword) 'from)
|
||||||
|
'elisp
|
||||||
|
(funcall (@ (guile) symbol->keyword) 'to)
|
||||||
|
'value)
|
||||||
|
t)
|
||||||
|
|
||||||
;;; Equality predicates
|
;;; Equality predicates
|
||||||
|
|
||||||
(fset 'eq (@ (guile) eq?))
|
(fset 'eq (@ (guile) eq?))
|
||||||
|
|
|
@ -22,9 +22,7 @@
|
||||||
(define-module (language elisp runtime subrs)
|
(define-module (language elisp runtime subrs)
|
||||||
#:use-module (language elisp runtime)
|
#:use-module (language elisp runtime)
|
||||||
#:use-module (system base compile)
|
#:use-module (system base compile)
|
||||||
#:export (apply
|
#:export (apply))
|
||||||
eval
|
|
||||||
load))
|
|
||||||
|
|
||||||
;;; Function calls. These must take care of special cases, like using
|
;;; Function calls. These must take care of special cases, like using
|
||||||
;;; symbols or raw lambda-lists as functions!
|
;;; symbols or raw lambda-lists as functions!
|
||||||
|
@ -41,12 +39,3 @@
|
||||||
func)))
|
func)))
|
||||||
(else func))))
|
(else func))))
|
||||||
(prim apply (@ (guile) apply) real-func args)))
|
(prim apply (@ (guile) apply) real-func args)))
|
||||||
|
|
||||||
;;; Miscellaneous.
|
|
||||||
|
|
||||||
(define (eval form)
|
|
||||||
(compile form #:from 'elisp #:to 'value))
|
|
||||||
|
|
||||||
(define (load file)
|
|
||||||
(compile-file file #:from 'elisp #:to 'value)
|
|
||||||
#t)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue