1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Add compiler macros for cl-oddp and cl-evenp

* lisp/emacs-lisp/cl-lib.el (cl-oddp, cl-evenp): Add compiler macros.
This commit is contained in:
Stefan Kangas 2025-02-12 17:59:45 +01:00
parent 44c11cd424
commit 31381f982d

View file

@ -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