This "community wiki" answer is here to provide an implementation of this function. Subsequently, the destructive operation (NCONC, MAPCAN) is not used, since the implementation can return the internal list without copying it. MAPPEND is imported from alexandria , and MOP operations can be imported from closer-mop .
(defun all-direct-slots (class) (append (class-direct-slots class) (mappend #'all-direct-slots (class-direct-superclasses class)))) (defun all-slot-readers (class) (mappend #'slot-definition-readers (all-direct-slots class)))
source share