Subject: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?

From: Andrea Corallo <[email-masked]>
Date: Wed, 1 Jul 2020 12:46:57 +0000 (UTC)

The attached is setting as pure: arrayp, bool-vector-p, consp,
char-or-string-p, floatp, hash-table-p, integerp, listp, natnump,
nlistp, not, null, string-lessp, stringp, symbolp, vectorp.

Feedback welcome.

Thanks

  Andrea
From 10c115da725581b3969dab7e453bf4b4fac185d3 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <[email-masked]>
Date: Wed, 1 Jul 2020 10:07:57 +0200
Subject: [PATCH] * Add some function to pure-fns

	* lisp/emacs-lisp/byte-opt.el (pure-fns): Add: arrayp,
	bool-vector-p, consp, char-or-string-p, floatp, hash-table-p,
	integerp, listp, natnump, nlistp, not, null, string-lessp,
	stringp, symbolp, vectorp.
---
 lisp/emacs-lisp/byte-opt.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 12bde8faf3..f3f1acbd65 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1307,9 +1307,11 @@
 ;; values if a marker is moved.
 
 (let ((pure-fns
-       '(% concat logand logcount logior lognot logxor
-	 regexp-opt regexp-quote
-	 string-to-char string-to-syntax symbol-name)))
+       '(% arrayp bool-vector-p char-or-string-p concat consp floatp
+         hash-table-p integerp listp logand logcount logior lognot
+         logxor natnump nlistp not null regexp-opt regexp-quote
+         string-lessp string-to-char string-to-syntax stringp
+         symbol-name symbolp vectorp)))
   (while pure-fns
     (put (car pure-fns) 'pure t)
     (setq pure-fns (cdr pure-fns)))
-- 
2.20.1