]> git.eshelyaron.com Git - emacs.git/commitdiff
Generalize 'comp-cstr-symbol-p'
authorAndrea Corallo <acorallo@gnu.org>
Fri, 31 May 2024 08:08:18 +0000 (10:08 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 11 Jul 2024 14:39:57 +0000 (16:39 +0200)
* 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

index d5912f6e58ae5a0b490485534cd05684b8469b47..8b48ce3455a8ceb502ae7cbf2a73f3a5c5253b9e 100644 (file)
@@ -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."