use defsubst
authorRobin Templeton <robin@terpri.org>
Tue, 5 Aug 2014 03:13:03 +0000 (23:13 -0400)
committerRobin Templeton <robin@terpri.org>
Fri, 13 Feb 2015 00:18:54 +0000 (19:18 -0500)
module/language/elisp/boot.el

index fae86a2..0d16905 100644 (file)
     (%funcall (@ (language elisp runtime) eval-elisp) form)))
 
 (eval-and-compile
-  (defun null (object)
+  (defsubst null (object)
+    (declare (lexical object))
     (if object nil t))
-  (defun consp (object)
-    (%funcall (@ (guile) pair?) object))
+  (defsubst consp (x)
+    (declare (lexical x))
+    (%funcall (@ (guile) pair?) x))
+  (defsubst atom (x)
+    (declare (lexical x))
+    (null (consp x)))
   (defun listp (object)
+    (declare (lexical object))
     (if object (consp object) t))
-  (defun car (list)
+  (defsubst car (list)
+    (declare (lexical list))
     (if list (%funcall (@ (guile) car) list) nil))
-  (defun cdr (list)
+  (defsubst cdr (list)
+    (declare (lexical list))
     (if list (%funcall (@ (guile) cdr) list) nil))
   (defun make-symbol (name)
     (%funcall (@ (guile) make-symbol) name))