Method: (RUCKSACK-MAP-SLOT STANDARD-RUCKSACK T T T)

Source

(defmethod rucksack-map-slot ((rucksack standard-rucksack) class slot function
                              &key min max include-min include-max
                              (equal nil equal-supplied)
                              (order :ascending) (include-subclasses t))
  (let ((visited-p (make-hash-table)))
    (labels ((map-slot (class)
               (let ((index (rucksack-slot-index rucksack class slot
                                                 :errorp nil)))
                 (when index
                   ;; The index maps slot values to objects.
                   (apply #'map-index
                          index
                          (lambda (slot-value object)
                            (declare (ignore slot-value))
                            (funcall function object))
                          :min min
                          :max max
                          :include-min include-min
                          :include-max include-max
                          :order order
                          (if equal-supplied (list :equal equal) '()))
                   (setf (gethash class visited-p) t))
                 (when include-subclasses
                   (loop for class in (class-direct-subclasses
                                       (if (symbolp class)
                                           (find-class class)
                                         class))
                         unless (gethash class visited-p)
                         do (map-slot class))))))
      (map-slot (if (symbolp class) (find-class class) class)))))
Source Context