From 7e62fb69ea921323e3448fcac910c600d3df23b8 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 31 May 2024 10:08:18 +0200 Subject: [PATCH] Generalize 'comp-cstr-symbol-p' * lisp/emacs-lisp/comp-cstr.el (comp-cstr-symbol-p): Make use of 'comp-cstr-type-p'. (cherry picked from commit 0d6f3f134e4e9e41df86e015ea5cfc0a990b62e5) --- lisp/emacs-lisp/comp-cstr.el | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index d5912f6e58a..8b48ce3455a 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -925,15 +925,6 @@ Non memoized version of `comp-cstr-intersection-no-mem'." (> high most-positive-fixnum)) t)))))) -(defun comp-cstr-symbol-p (cstr) - "Return t if CSTR is certainly a symbol." - (with-comp-cstr-accessors - (and (null (range cstr)) - (null (neg cstr)) - (and (or (null (typeset cstr)) - (equal (typeset cstr) '(symbol))) - (cl-every #'symbolp (valset cstr)))))) - (defsubst comp-cstr-cons-p (cstr) "Return t if CSTR is certainly a cons." (with-comp-cstr-accessors @@ -964,6 +955,10 @@ Non memoized version of `comp-cstr-intersection-no-mem'." (error "Unknown predicate for type %s" type))))) t)) +(defun comp-cstr-symbol-p (cstr) + "Return t if CSTR is certainly a symbol." + (comp-cstr-type-p cstr 'symbol)) + ;; Move to comp.el? (defsubst comp-cstr-cl-tag-p (cstr) "Return non-nil if CSTR is a CL tag." -- 2.39.2