Subject: Re: bug#77725: 31.0.50; Add support for types accepted by `cl-typep' to cl-generic?

From: David Ponce <[email-masked]>
Date: Sat, 19 Apr 2025 12:11:25 +0200

> Regarding a possible merge in cl-lib, should cl-types.el be copied at
> the end of cl-lib, after cl-macs is loaded?  If I correctly understand
> the logic of loading these libs ;-)

I looked into this a bit more, and it turns out that cl-generic
depends on cl-lib, so the code in cl-types.el that depends on
cl-generic can't go in cl-lib. This concern the two definitions
at the end of cl-types.el:

(cl-generic-define-generalizer cl--type-generalizer
   ...
   )

(cl-defmethod cl-generic-generalizers :extra "cl-types-of" (type)
  ...
   )

which could logically go in cl-generic?

I attached a slightly updated version of cl-types.el, mainly to check
first if a type is of class `cl-type-class' in `cl-types-of', and to
use the predicate `cl-type-class-p' simpler than `cl-typep'.

Happy Easter weekend :-)