summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2018-07-12 10:29:28 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2018-07-12 10:29:28 -0400
commitaeefbc41be093ceb1222d9b430fb44b69de660e2 (patch)
treeb74878610dce5ad1a50c6047ef12504c4a9c7604 /lisp/subr.el
parent84e5986902c7d7274f438c48c82949436eb9093d (diff)
downloademacs-aeefbc41be093ceb1222d9b430fb44b69de660e2.tar.gz
Fix the bootstrap differently, so zerop can be where it belongs
Suggested by Robert Pluim <rpluim@gmail.com>. * lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Avoid cadr/cddr. * lisp/subr.el (zerop): Un-revert 2018-07-10T23:08:58-07:00!contovob@tcd.ie.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index a5108eb6558..10343e69db8 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -359,6 +359,13 @@ was called."
(lambda (&rest args2)
(apply fun (append args args2))))
+(defun zerop (number)
+ "Return t if NUMBER is zero."
+ ;; Used to be in C, but it's pointless since (= 0 n) is faster anyway because
+ ;; = has a byte-code.
+ (declare (compiler-macro (lambda (_) `(= 0 ,number))))
+ (= 0 number))
+
;;;; List functions.
@@ -548,16 +555,6 @@ If N is omitted or nil, remove the last element."
(if (> n 0) (setcdr (nthcdr (- (1- m) n) list) nil))
list))))
-;; This function appears here instead of under the 'Basic Lisp
-;; functions' heading because during bootstrap its compiler-macro
-;; requires functions defined under the 'List functions' heading.
-(defun zerop (number)
- "Return t if NUMBER is zero."
- ;; Used to be in C, but it's pointless since (= 0 n) is faster anyway because
- ;; = has a byte-code.
- (declare (compiler-macro (lambda (_) `(= 0 ,number))))
- (= 0 number))
-
(defun proper-list-p (object)
"Return OBJECT's length if it is a proper list, nil otherwise.
A proper list is neither circular nor dotted (i.e., its last cdr