]> git.eshelyaron.com Git - emacs.git/commit
(cl-type-of): New function to return more precise types (bug#69739)
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 12 Mar 2024 13:26:24 +0000 (09:26 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 18 Mar 2024 15:45:24 +0000 (16:45 +0100)
commit2b66c6e79fb7f6004225b3f6322a41c5e0f99a2f
tree37701738598c799d49eab49cf6b7355d7f7e8ae2
parentd0be195fcd9aa05915e26e618508fdda661dd0a4
(cl-type-of): New function to return more precise types (bug#69739)

* src/data.c (Fcl_type_of): New function, extracted from `Ftype_of`.
Make it return more precise types for symbols, integers, and subrs.
(Ftype_of): Use it.
(syms_of_data): Define the corresponding new symbols and defsubr
the new function.

* doc/lispref/objects.texi (Type Predicates): Document it.

* src/comp.c (emit_limple_insn): Use `Fcl_type_of`.

* lisp/emacs-lisp/cl-preloaded.el (subr): Demote it to `atom`.
(subr-native-elisp, subr-primitive): Add `compiled-function` as
parent instead.
(special-form): New type.

* lisp/obsolete/eieio-core.el (cl--generic-struct-tag):
* lisp/emacs-lisp/cl-generic.el (cl--generic-typeof-generalizer):
Use `cl-type-of`.
cl--generic--unreachable-types): Update accordingly.

test/src/data-tests.el (data-tests--cl-type-of): New test.

(cherry picked from commit 706403f2aa3a306369a0150022da0cba1802ca2b)
doc/lispref/objects.texi
etc/NEWS
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/cl-preloaded.el
lisp/emacs-lisp/eieio-core.el
src/comp.c
src/data.c
test/src/data-tests.el