+
+(defmethod perform-define-attributes ((model t) attributes)
+ (loop for attribute in attributes
+ do (destructuring-bind (name type &rest args)
+ attribute
+ (cond ((eq type t)
+ ;;use the existing (default) type
+ (set-attribute-properties model name args))
+ ((not (null type))
+ ;;set the type as well
+ (set-attribute model name (cons type args)))))))
+
+(defmacro define-attributes (models &body attribute-definitions)
+ `(progn
+ ,@(loop for model in models
+ collect `(perform-define-attributes (quote ,model) (quote ,attribute-definitions)))
+ (mapcar #'find-class-attributes (quote ,models ))))