Macro: RUCKSACK-DO-SLOT

Documentation

Evaluate BODY for each instance of CLASS where SLOT has the specified value. INSTANCE-VAR will be bound successively to each instance. See the documentation of RUCKSACK-MAP-SLOT for more details.

Source

(defmacro rucksack-do-slot ((instance-var class slot
                             &rest args
                             &key (rucksack '*rucksack*)
                             equal min max include-min include-max
                             order include-subclasses)
                            &body body)
  "Evaluate BODY for each instance of CLASS where SLOT has the
specified value. INSTANCE-VAR will be bound successively to each
instance.  See the documentation of RUCKSACK-MAP-SLOT for more
details."
  (declare (ignorable equal min max include-min include-max order
                      include-subclasses))
  (check-type instance-var symbol)
  `(rucksack-map-slot ,rucksack ,class ,slot
                      (lambda (,instance-var) ,@body)
                      ,@(sans args ':rucksack)))
Source Context