mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +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 () ,@unwindforms)))
|
||||
|
||||
(fset 'eval (@ (language elisp runtime subrs) eval))
|
||||
(fset' load (@ (language elisp runtime subrs) load))
|
||||
|
||||
(defun throw (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
|
||||
|
||||
(fset 'eq (@ (guile) eq?))
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
(define-module (language elisp runtime subrs)
|
||||
#:use-module (language elisp runtime)
|
||||
#:use-module (system base compile)
|
||||
#:export (apply
|
||||
eval
|
||||
load))
|
||||
#:export (apply))
|
||||
|
||||
;;; Function calls. These must take care of special cases, like using
|
||||
;;; symbols or raw lambda-lists as functions!
|
||||
|
@ -41,12 +39,3 @@
|
|||
func)))
|
||||
(else func))))
|
||||
(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