diff options
| author | Stefan Monnier | 2024-03-17 17:29:02 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2024-03-18 09:32:49 -0400 |
| commit | e624bc62752ceb2e60940c5fd9cb6e70611df71c (patch) | |
| tree | 43890e0601aacb600479590fb52ba5440e4fca91 /src/data.c | |
| parent | 706403f2aa3a306369a0150022da0cba1802ca2b (diff) | |
| download | emacs-e624bc62752ceb2e60940c5fd9cb6e70611df71c.tar.gz emacs-e624bc62752ceb2e60940c5fd9cb6e70611df71c.zip | |
(primitive-function): New type
The type hierarchy and `cl-type-of` code assumed that `subr-primitive`
only applies to functions, but since it also accepts special-forms it makes
it an unsuitable choice since it can't be a subtype of `compiled-function`.
So, use a new type `primitive-function` instead.
* lisp/subr.el (subr-primitive-p): Fix docstring (bug#69832).
(primitive-function-p): New function.
* lisp/emacs-lisp/cl-preloaded.el (primitive-function): Rename
from `subr-primitive` since `subr-primitive-p` means something else.
* src/data.c (Fcl_type_of): Return `primitive-function` instead
of `subr-primitive` for C functions.
(syms_of_data): Adjust accordingly.
* test/src/data-tests.el (data-tests--cl-type-of): Remove workaround.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/data.c b/src/data.c index 5d6b6e0ba9d..69b990bed76 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -248,7 +248,7 @@ a fixed set of types. */) | |||
| 248 | case PVEC_SUBR: | 248 | case PVEC_SUBR: |
| 249 | return XSUBR (object)->max_args == UNEVALLED ? Qspecial_form | 249 | return XSUBR (object)->max_args == UNEVALLED ? Qspecial_form |
| 250 | : SUBR_NATIVE_COMPILEDP (object) ? Qsubr_native_elisp | 250 | : SUBR_NATIVE_COMPILEDP (object) ? Qsubr_native_elisp |
| 251 | : Qsubr_primitive; | 251 | : Qprimitive_function; |
| 252 | case PVEC_COMPILED: return Qcompiled_function; | 252 | case PVEC_COMPILED: return Qcompiled_function; |
| 253 | case PVEC_BUFFER: return Qbuffer; | 253 | case PVEC_BUFFER: return Qbuffer; |
| 254 | case PVEC_CHAR_TABLE: return Qchar_table; | 254 | case PVEC_CHAR_TABLE: return Qchar_table; |
| @@ -4245,7 +4245,7 @@ syms_of_data (void) | |||
| 4245 | DEFSYM (Qwindow, "window"); | 4245 | DEFSYM (Qwindow, "window"); |
| 4246 | DEFSYM (Qsubr, "subr"); | 4246 | DEFSYM (Qsubr, "subr"); |
| 4247 | DEFSYM (Qspecial_form, "special-form"); | 4247 | DEFSYM (Qspecial_form, "special-form"); |
| 4248 | DEFSYM (Qsubr_primitive, "subr-primitive"); | 4248 | DEFSYM (Qprimitive_function, "primitive-function"); |
| 4249 | DEFSYM (Qsubr_native_elisp, "subr-native-elisp"); | 4249 | DEFSYM (Qsubr_native_elisp, "subr-native-elisp"); |
| 4250 | DEFSYM (Qcompiled_function, "compiled-function"); | 4250 | DEFSYM (Qcompiled_function, "compiled-function"); |
| 4251 | DEFSYM (Qbuffer, "buffer"); | 4251 | DEFSYM (Qbuffer, "buffer"); |