mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 02:31:03 -08:00
Adjust side-effect-free declarations
* lisp/emacs-lisp/byte-opt.el (side-effect-and-error-free-fns): Add `eql` here. * lisp/emacs-lisp/cl-macs.el (eql, cl-subst, cl-sublis): Don't set the `side-effect-free` property here. `cl-subst` and `cl-sublis` are not side-effect-free. * lisp/emacs-lisp/cl-extra.el (cl-revappend): Declare side-effect-free. * lisp/emacs-lisp/cl-lib.el (cl-copy-list): Declare side-effect-free and error-free.
This commit is contained in:
parent
c9e13048bb
commit
48ff93ba18
4 changed files with 6 additions and 4 deletions
|
|
@ -1706,7 +1706,7 @@ See Info node `(elisp) Integer Basics'."
|
||||||
charsetp commandp cons consp
|
charsetp commandp cons consp
|
||||||
current-buffer current-global-map current-indentation
|
current-buffer current-global-map current-indentation
|
||||||
current-local-map current-minor-mode-maps current-time
|
current-local-map current-minor-mode-maps current-time
|
||||||
eobp eolp eq equal
|
eobp eolp eq equal eql
|
||||||
floatp following-char framep
|
floatp following-char framep
|
||||||
hash-table-p
|
hash-table-p
|
||||||
identity indirect-function integerp integer-or-marker-p
|
identity indirect-function integerp integer-or-marker-p
|
||||||
|
|
|
||||||
|
|
@ -567,6 +567,7 @@ too large if positive or too small if negative)."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun cl-revappend (x y)
|
(defun cl-revappend (x y)
|
||||||
"Equivalent to (append (reverse X) Y)."
|
"Equivalent to (append (reverse X) Y)."
|
||||||
|
(declare (side-effect-free t))
|
||||||
(nconc (reverse x) y))
|
(nconc (reverse x) y))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
||||||
|
|
@ -459,6 +459,7 @@ Thus, `(cl-list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to
|
||||||
(defun cl-copy-list (list)
|
(defun cl-copy-list (list)
|
||||||
"Return a copy of LIST, which may be a dotted list.
|
"Return a copy of LIST, which may be a dotted list.
|
||||||
The elements of LIST are not copied, just the list structure itself."
|
The elements of LIST are not copied, just the list structure itself."
|
||||||
|
(declare (side-effect-free error-free))
|
||||||
(if (consp list)
|
(if (consp list)
|
||||||
(let ((res nil))
|
(let ((res nil))
|
||||||
(while (consp list) (push (pop list) res))
|
(while (consp list) (push (pop list) res))
|
||||||
|
|
|
||||||
|
|
@ -3690,14 +3690,14 @@ macro that returns its `&whole' argument."
|
||||||
|
|
||||||
;;; Things that are side-effect-free.
|
;;; Things that are side-effect-free.
|
||||||
(mapc (lambda (x) (function-put x 'side-effect-free t))
|
(mapc (lambda (x) (function-put x 'side-effect-free t))
|
||||||
'(cl-oddp cl-evenp cl-signum last butlast cl-ldiff cl-pairlis cl-gcd
|
'(cl-oddp cl-evenp cl-signum cl-ldiff cl-pairlis cl-gcd
|
||||||
cl-lcm cl-isqrt cl-floor cl-ceiling cl-truncate cl-round cl-mod cl-rem
|
cl-lcm cl-isqrt cl-floor cl-ceiling cl-truncate cl-round cl-mod cl-rem
|
||||||
cl-subseq cl-list-length cl-get cl-getf))
|
cl-subseq cl-list-length cl-get cl-getf))
|
||||||
|
|
||||||
;;; Things that are side-effect-and-error-free.
|
;;; Things that are side-effect-and-error-free.
|
||||||
(mapc (lambda (x) (function-put x 'side-effect-free 'error-free))
|
(mapc (lambda (x) (function-put x 'side-effect-free 'error-free))
|
||||||
'(eql cl-list* cl-subst cl-acons cl-equalp
|
'(cl-list* cl-acons cl-equalp
|
||||||
cl-random-state-p copy-tree cl-sublis))
|
cl-random-state-p copy-tree))
|
||||||
|
|
||||||
;;; Types and assertions.
|
;;; Types and assertions.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue