- `(let ((attr ,(cond (attr (cons 'list (make-object-attributes attr)))))
- (bhv ,(cond (bhv (cons 'list (make-object-behaviour bhv))))))
- (defun ,name (option &rest param)
- (case option
- (:get-attr attr)
- (:set-attr (setq attr @param))
- (:get-bhv bhv)
- (:render ,@look)))))
+ `(progn
+ (let ((attr ,(cond (attr (cons 'list (make-object-attributes attr)))))
+ (bhv ,(cond (bhv (cons 'list (make-object-behaviour bhv))))))
+ (defun ,name (option &rest param)
+ (case option
+ (:action (dolist (b bhv t) (setq attr (funcall (get-behaviour-fun-name b) attr))))
+ (:get-attr attr)
+ (:get-bhv bhv)
+ (:set-bhv (setq bhv (car param)))
+ (:render ,@look))))
+ (add-object ',name)
+ ',name))