You cannot change the class hierarchy as you imagine it, but you can achieve almost the same effect.
Suppose your definition of a sequence is that it has a method for the sequence-length function.
(defclass sequence ...) (defmethod sequence-length ((s sequence)) ...)
Then you can easily extend your sequence-length method to the end:
(defmethod sequence-length ((s cons)) (length s))
Has this class created a new class that includes cons ? Not really. You can express the type of things that have a sequence-length method by saying (or sequence cons) , but this is not very useful.
source share