summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2025-02-12 17:59:45 +0100
committerStefan Kangas <stefankangas@gmail.com>2025-02-12 21:30:30 +0100
commit31381f982dd6f17132a77bc41735a2fcf7cf5d6b (patch)
treea90641e8afe2f5f3521ce9240cf9d3edc2ee61fe /lisp/emacs-lisp
parent44c11cd4241ffc8636135bc41ac718101666d34d (diff)
downloademacs-31381f982dd6f17132a77bc41735a2fcf7cf5d6b.tar.gz
emacs-31381f982dd6f17132a77bc41735a2fcf7cf5d6b.tar.bz2
emacs-31381f982dd6f17132a77bc41735a2fcf7cf5d6b.zip
Add compiler macros for cl-oddp and cl-evenp
* lisp/emacs-lisp/cl-lib.el (cl-oddp, cl-evenp): Add compiler macros.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-lib.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 3f7ca28d2bb..2759fc0a028 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -280,10 +280,12 @@ so that they are registered at compile-time as well as run-time."
(defun cl-oddp (integer)
"Return t if INTEGER is odd."
+ (declare (compiler-macro (lambda (_) `(eq (logand ,integer 1) 1))))
(eq (logand integer 1) 1))
(defun cl-evenp (integer)
"Return t if INTEGER is even."
+ (declare (compiler-macro (lambda (_) `(eq (logand ,integer 1) 0))))
(eq (logand integer 1) 0))
(defconst cl-digit-char-table