1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Generalize 'comp-cstr-symbol-p'

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-symbol-p): Make use of
'comp-cstr-type-p'.
This commit is contained in:
Andrea Corallo 2024-05-31 10:08:18 +02:00
parent a1775552ce
commit 0d6f3f134e

View file

@ -926,15 +926,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
@ -965,6 +956,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."