mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-21 03:00:19 +02:00
simplify elisp symbol accessors
* module/language/elisp/boot.el (fset, symbol-value, symbol-function) (set, makunbound, fmakunbound, boundp, fboundp): Use procedures in `(language elisp runtime)'. (symbolp): New function. * module/language/elisp/compile-tree-il.scm (set-variable!): Use `set-symbol-function!'. * module/language/elisp/runtime.scm (reference-variable, set-variable!): Remove. (symbol-fluid, set-symbol-fluid!): New procedure. (symbol-value, set-symbol-value!, symbol-function) (set-symbol-function!, symbol-bound?, symbol-fbound?, makunbound!) (fmakunbound!): Moved from `(language elisp subrs)' and updated to avoid using `reference-variable' and `set-variable!'. * module/language/elisp/runtime/subrs.scm (symbol-value) (symbol-function, set, fset, makunbound, fmakunbound, boundp) (fboundp): Move to `(language elisp runtime)'. (apply): Use `symbol-function'.
This commit is contained in:
parent
12ca82caa2
commit
85bc6238bf
4 changed files with 92 additions and 99 deletions
|
@ -31,7 +31,9 @@
|
|||
(defun funcall (function &rest arguments)
|
||||
(apply function arguments))
|
||||
(defun fset (symbol definition)
|
||||
(funcall (@ (language elisp runtime subrs) fset) symbol definition))
|
||||
(funcall (@ (language elisp runtime) set-symbol-function!)
|
||||
symbol
|
||||
definition))
|
||||
(defun null (object)
|
||||
(if object nil t))
|
||||
(fset 'consp (@ (guile) pair?))
|
||||
|
@ -115,13 +117,6 @@
|
|||
#'(lambda () ,bodyform)
|
||||
#'(lambda () ,@unwindforms)))
|
||||
|
||||
(fset 'symbol-value (@ (language elisp runtime subrs) symbol-value))
|
||||
(fset 'symbol-function (@ (language elisp runtime subrs) symbol-function))
|
||||
(fset 'set (@ (language elisp runtime subrs) set))
|
||||
(fset 'makunbound (@ (language elisp runtime subrs) makunbound))
|
||||
(fset 'fmakunbound (@ (language elisp runtime subrs) fmakunbound))
|
||||
(fset 'boundp (@ (language elisp runtime subrs) boundp))
|
||||
(fset 'fboundp (@ (language elisp runtime subrs) fboundp))
|
||||
(fset 'eval (@ (language elisp runtime subrs) eval))
|
||||
(fset' load (@ (language elisp runtime subrs) load))
|
||||
|
||||
|
@ -133,6 +128,17 @@
|
|||
(fset 'eq (@ (guile) eq?))
|
||||
(fset 'equal (@ (guile) equal?))
|
||||
|
||||
;;; Symbols
|
||||
|
||||
(fset 'symbolp (@ (guile) symbol?))
|
||||
(fset 'symbol-value (@ (language elisp runtime) symbol-value))
|
||||
(fset 'symbol-function (@ (language elisp runtime) symbol-function))
|
||||
(fset 'set (@ (language elisp runtime) set-symbol-value!))
|
||||
(fset 'makunbound (@ (language elisp runtime) makunbound!))
|
||||
(fset 'fmakunbound (@ (language elisp runtime) fmakunbound!))
|
||||
(fset 'boundp (@ (language elisp runtime) symbol-bound?))
|
||||
(fset 'fboundp (@ (language elisp runtime) symbol-fbound?))
|
||||
|
||||
;;; Numerical type predicates
|
||||
|
||||
(defun floatp (object)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue