diff options
| author | Stefan Monnier | 2025-03-25 02:09:48 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2025-03-25 02:09:48 -0400 |
| commit | 7ec0ee742da17864b554e2cf4384d2a12baaf1e8 (patch) | |
| tree | 6bd6a7efec309743654230c9af187e63c2ab0f20 | |
| parent | c3492b969da3b117904a070a2617b31dd965f109 (diff) | |
| download | emacs-7ec0ee742da17864b554e2cf4384d2a12baaf1e8.tar.gz emacs-7ec0ee742da17864b554e2cf4384d2a12baaf1e8.zip | |
(built-in-class--make): Take list of types rather than classes
Consolidate the conversion from types to classes into
`built-in-class--make` instead of duplicating it in ever caller.
* lisp/emacs-lisp/cl-preloaded.el (built-in-class--make): Take list of
types rather than classes.
(cl--define-built-in-type): Simplify accordingly.
| -rw-r--r-- | lisp/emacs-lisp/cl-preloaded.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 7017fcd5b83..dfea8d6c8e3 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el | |||
| @@ -292,7 +292,13 @@ | |||
| 292 | (:include cl--class) | 292 | (:include cl--class) |
| 293 | (:noinline t) | 293 | (:noinline t) |
| 294 | (:constructor nil) | 294 | (:constructor nil) |
| 295 | (:constructor built-in-class--make (name docstring parents)) | 295 | (:constructor built-in-class--make |
| 296 | (name docstring parent-types | ||
| 297 | &aux (parents | ||
| 298 | (mapcar (lambda (type) | ||
| 299 | (or (get type 'cl--class) | ||
| 300 | (error "Unknown type: %S" type))) | ||
| 301 | parent-types)))) | ||
| 296 | (:copier nil)) | 302 | (:copier nil)) |
| 297 | "Type descriptors for built-in types. | 303 | "Type descriptors for built-in types. |
| 298 | The `slots' (and hence `index-table') are currently unused." | 304 | The `slots' (and hence `index-table') are currently unused." |
| @@ -322,13 +328,7 @@ The `slots' (and hence `index-table') are currently unused." | |||
| 322 | ;; (message "Missing predicate for: %S" name) | 328 | ;; (message "Missing predicate for: %S" name) |
| 323 | nil) | 329 | nil) |
| 324 | (put ',name 'cl--class | 330 | (put ',name 'cl--class |
| 325 | (built-in-class--make ',name ,docstring | 331 | (built-in-class--make ',name ,docstring ',parents))))) |
| 326 | (mapcar (lambda (type) | ||
| 327 | (let ((class (get type 'cl--class))) | ||
| 328 | (unless class | ||
| 329 | (error "Unknown type: %S" type)) | ||
| 330 | class)) | ||
| 331 | ',parents)))))) | ||
| 332 | 332 | ||
| 333 | ;; FIXME: Our type DAG has various quirks: | 333 | ;; FIXME: Our type DAG has various quirks: |
| 334 | ;; - Some `keyword's are also `symbol-with-pos' but that's not reflected | 334 | ;; - Some `keyword's are also `symbol-with-pos' but that's not reflected |