On 2025-05-24 12:52, David Ponce wrote: > Hello Stefan, > > Please find below the proposal for a new approach to speed up dispatch > of methods with derived type specializers. Hello Stefan, Following our last exchange in French, to feed our discussion more concretely, please find attached a new patch that explore further the idea of removing the global variable `cl--derived-type-list', and make `cl-types-of' a private function named `cl--derived-type-specializers' with a mandatory argument to receive the list of dispatch types to check. The patch also improve a little the `cl-deftype' macro to allow dispatching of atomic derived type with both optional arguments and parents, like in this example: (cl-deftype my-integer () 'integer) ;; Currently the below declaration is not valid because ARGLIST and ;; PARENTS are both non-nil. (cl-deftype unsigned-byte (&optional bits) "Unsigned integer." (declare (parents my-integer)) `(integer 0 ,(if (memq bits '(nil *)) bits (1- (ash 1 bits))))) (cl-defmethod test-byte ((this my-integer)) (format "%S is an integer" this)) (cl-defmethod test-byte ((this unsigned-byte)) (format "%S is an unsigned byte - %s" this (cl-call-next-method))) David