Commit f3542ace authored by Stas Boukarev's avatar Stas Boukarev
Browse files

map-type: Operate on all types, not just classes.

parent 0f2723fa
......@@ -31,14 +31,21 @@
(funcall function
class (objects-of-class class)))))
(defun map-type-class (superclass function)
(dolist (class (storage-data *storage*))
(when (subtypep class superclass)
(map nil function
(objects-of-class class)))))
(defun map-type (type function)
(let ((type (if (eql type t)
(dolist (class (storage-data *storage*))
(when (subtypep class type)
(map nil function
(objects-of-class class))))))
(let ((class (and (symbolp type)
(find-class type nil))))
(if class
(map-type-class class function)
(dolist (class (storage-data *storage*))
(dolist (object (objects-of-class class))
(when (typep object type)
(funcall function object)))))))
(defmethod update-instance-for-different-class
:after ((previous identifiable) (current identifiable) &key)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment