]> git.eshelyaron.com Git - emacs.git/commitdiff
Promote 'constantly' from 'cl-constantly'
authorEshel Yaron <me@eshelyaron.com>
Fri, 11 Apr 2025 06:45:50 +0000 (08:45 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 11 Apr 2025 06:46:09 +0000 (08:46 +0200)
lisp/emacs-lisp/cl-lib.el
lisp/subr.el

index 381fbee63d31a490248a6e9629d1539145a17d1a..8694a60d8fa3bae34b9cd926c0df04cebbb43a6e 100644 (file)
@@ -590,9 +590,6 @@ of record objects."
     (advice-remove 'type-of #'cl--old-struct-type-of))))
 (make-obsolete 'cl-old-struct-compat-mode nil "30.1")
 
-(defun cl-constantly (value)
-  "Return a function that takes any number of arguments, but returns VALUE."
-  (lambda (&rest _)
-    value))
+(defalias 'cl-constantly #'constantly)
 
 ;;; cl-lib.el ends here
index 1631f4ac621a6af6505cd6232b5e35501e5d0ec1..859407098ac63abe856e6af33ea840b50db45ce4 100644 (file)
@@ -521,6 +521,10 @@ Also see `ignore'."
   (declare (pure t) (side-effect-free error-free))
   t)
 
+(defun constantly (value)
+  "Return a function that takes any number of arguments, but returns VALUE."
+  (lambda (&rest _) value))
+
 (defun error (string &rest args)
   "Signal an error, making a message by passing ARGS to `format-message'.
 Errors cause entry to the debugger when `debug-on-error' is non-nil.