]> git.eshelyaron.com Git - emacs.git/commit
(cl--typeof-types): Rework to fix some regressions
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 3 Mar 2024 23:08:50 +0000 (18:08 -0500)
committerEshel Yaron <me@eshelyaron.com>
Tue, 5 Mar 2024 15:10:55 +0000 (16:10 +0100)
commit90fc1c439227cde522d363b8474b76638bbfd25a
tree44ca102a1e4fdcf5767c1d460dc65c6fd5e743d1
parent8cf21f54ec07c69336fdbcf6c79caea0e280ec1c
(cl--typeof-types): Rework to fix some regressions

Initialize the variables directly in their declaration, so
there no time where they exist but aren't yet initialized.
This also allows us to mark `cl--typeof-types` as a `defconst` again.

More importantly, specify the DAG by direct supertypes rather
than direct subtypes.  This is slightly less compact, but it's
necessary to let us specify the *order* of the supertypes,
which is necessary for example to preserve the desired ordering
of methods when several methods can be applied.

Fix a few more regressions, such as removing `atom` from the parents
of `function` since some lists are considered as functions,
adding `number-or-marker` as supertype of `integer-or-marker`,
and re-adding `native-comp-unit`.

I carefully compared all elements of `cl--typeof-types` to make
sure they are the same as before (with one exception for `null`).

* lisp/emacs-lisp/cl-preloaded.el (cl--type-hierarchy): Delete var.
(cl--direct-supertypes-of-type, cl--typeof-types):
Initialize directly in the declaration.
(cl--supertypes-lane, cl--supertypes-lanes-res): Delete vars.
(cl--supertypes-for-typeof-types-rec)
(cl--supertypes-for-typeof-types): Delete functions.

(cherry picked from commit 1d9d07fb00e6b62641c07af68f986e700b5f6cee)
lisp/emacs-lisp/cl-preloaded.el