+
+(defun classify-slotds (slotds)
+ (let (instance-slots class-slots custom-slots bootp)
+ (dolist (slotd slotds)
+ (let ((alloc (cond ((consp slotd) ; bootstrap
+ (setf bootp t)
+ :instance)
+ (t
+ (slot-definition-allocation slotd)))))
+ (case alloc
+ (:instance
+ (push slotd instance-slots))
+ (:class
+ (push slotd class-slots))
+ (t
+ (push slotd custom-slots)))))
+ (values (if bootp
+ (nreverse instance-slots)
+ (when slotds
+ (sort instance-slots #'< :key #'slot-definition-location)))
+ class-slots
+ custom-slots)))