(defun inst (parent) "instances created with 'new' are auto-initialized" (let ((obj (inst0 parent))) (init obj) obj)) (defun dollarp (x) "Is x a symbol starting with '$'?" (and (symbolp x) (equal (elt (symbol-name x) 0) #\$))) (defparameter *object* (klass nil init with-zlots zlots with-vars)) (defparameter *something* (klass (*object*) eg)) (defmeth init *object* (u) (declare (ignore u)) (format t " init!")) (defmeth zlots *object* (self) (coerce (layout (parents self)) 'list)) (defmeth with-zlots *object* (self fn) (dolist (zlot (zlots self)) (funcall fn zlot (lookup zlot self)))) (defmeth with-vars *object* (self fn) (with-zlots self #'(lambda (prop value) (if (dollarp prop) (funcall fn prop value))))) (defun !init-something () (inst *something*))