[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 9830421e964 1/6: comp-cstr.el: Fix a minor error and prepare for
From: |
Stefan Monnier |
Subject: |
master 9830421e964 1/6: comp-cstr.el: Fix a minor error and prepare for upcoming changes |
Date: |
Fri, 8 Mar 2024 02:07:19 -0500 (EST) |
branch: master
commit 9830421e964cfb39077b69efd38d122e3bacf5d4
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
comp-cstr.el: Fix a minor error and prepare for upcoming changes
* lisp/emacs-lisp/comp-cstr.el (comp--cl-class-hierarchy): Add `atom`
and `t` only to those types whose "allparents" is clearly not complete.
(comp--compute--pred-type-h): Store the cstr rather than the type
in the hash-table, as expected by `comp--pred-to-cstr`.
---
lisp/emacs-lisp/comp-cstr.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 55d92841cd5..1c6acaa6385 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -89,12 +89,15 @@ Integer values are handled in the `range' slot.")
(defun comp--cl-class-hierarchy (x)
"Given a class name `x' return its hierarchy."
- `(,@(cl--class-allparents (cl--struct-get-class x))
- ;; FIXME: AFAICT, `comp--all-classes' will also find those struct types
- ;; which use :type and can thus be either `vector' or `cons' (the latter
- ;; isn't `atom').
- atom
- t))
+ (let ((parents (cl--class-allparents (cl--struct-get-class x))))
+ (if (memq t parents)
+ parents
+ `(,@parents
+ ;; FIXME: AFAICT, `comp--all-classes' will also find those struct types
+ ;; which use :type and can thus be either `vector' or `cons' (the
latter
+ ;; isn't `atom').
+ atom
+ t))))
(defun comp--all-classes ()
"Return all non built-in type names currently defined."
@@ -114,7 +117,7 @@ Integer values are handled in the `range' slot.")
for class-name in (comp--all-classes)
for pred = (get class-name 'cl-deftype-satisfies)
when pred
- do (puthash pred class-name h)
+ do (puthash pred (comp--type-to-cstr class-name) h)
finally return h))
(cl-defstruct comp-cstr-ctxt
- master updated (e4d1739a291 -> bd017175d45), Stefan Monnier, 2024/03/08
- master 7c127fc965f 4/6: Make "parentless" structs inherit from their builtin type, Stefan Monnier, 2024/03/08
- master 76e9c761a45 3/6: * lisp/emacs-lisp/oclosure.el (oclosure): Make it a subtype of `function`, Stefan Monnier, 2024/03/08
- master bd017175d45 6/6: Simplify type hierarchy operations, Stefan Monnier, 2024/03/08
- master 4fdcbd09af2 2/6: cl-preloaded.el (built-in-class): New type, Stefan Monnier, 2024/03/08
- master 945af4d9d11 5/6: eieio-core.el: Always put a parent in the parents of a class, Stefan Monnier, 2024/03/08
- master 9830421e964 1/6: comp-cstr.el: Fix a minor error and prepare for upcoming changes,
Stefan Monnier <=