1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-06 12:10:28 +02:00

use defsubst

(Best-ability ChangeLog annotation added by Christine Lemmer-Webber.)

* module/language/elisp/boot.el (null, consp, listp, car, cdr): Update
  to use defsubst.
  (atom): New variable, using defsubst.
This commit is contained in:
Robin Templeton 2014-08-04 23:13:03 -04:00 committed by Christine Lemmer-Webber
parent cfbf37d917
commit dcb55d3895
No known key found for this signature in database
GPG key ID: 4BC025925FF8F4D3

View file

@ -71,15 +71,23 @@
(%funcall (@ (language elisp runtime) eval-elisp) form))) (%funcall (@ (language elisp runtime) eval-elisp) form)))
(eval-and-compile (eval-and-compile
(defun null (object) (defsubst null (object)
(declare (lexical object))
(if object nil t)) (if object nil t))
(defun consp (object) (defsubst consp (x)
(%funcall (@ (guile) pair?) object)) (declare (lexical x))
(%funcall (@ (guile) pair?) x))
(defsubst atom (x)
(declare (lexical x))
(null (consp x)))
(defun listp (object) (defun listp (object)
(declare (lexical object))
(if object (consp object) t)) (if object (consp object) t))
(defun car (list) (defsubst car (list)
(declare (lexical list))
(if list (%funcall (@ (guile) car) list) nil)) (if list (%funcall (@ (guile) car) list) nil))
(defun cdr (list) (defsubst cdr (list)
(declare (lexical list))
(if list (%funcall (@ (guile) cdr) list) nil)) (if list (%funcall (@ (guile) cdr) list) nil))
(defun make-symbol (name) (defun make-symbol (name)
(%funcall (@ (guile) make-symbol) name)) (%funcall (@ (guile) make-symbol) name))