#'attribute-active-p
(description-attributes description)))
-(defun find-attribute (description attribute-name)
- (find attribute-name (description-attributes description)
- :key #'attribute-name))
+(defun find-attribute (description attribute-name &optional (errorp t))
+ (or (find attribute-name (description-attributes description)
+ :key #'attribute-name)
+ (when errorp (error "No attribute named ~A found in ~A describing ~A" attribute-name description (described-object description)))))
(define-layered-function description-active-descriptions (description)
(:method ((description standard-description-object))
(find-attribute description 'active-attributes))
(attributes (when active-attributes
(ignore-errors (attribute-value active-attributes)))))
- (if attributes
- (mapcar (lambda (spec)
- (find-attribute
- description
- (if (listp spec)
- (car spec)
- spec)))
- attributes)
- (remove-if-not
- (lambda (attribute)
- (and (attribute-active-p attribute)
- (some #'layer-active-p
- (mapcar #'find-layer
- (slot-definition-layers
- (attribute-effective-attribute-definition attribute))))))
+ (remove-if-not
+ (lambda (attribute)
+ (and attribute
+ (attribute-active-p attribute)
+ (some #'layer-active-p
+ (mapcar #'find-layer
+ (slot-definition-layers
+ (attribute-effective-attribute-definition attribute))))))
+ (if attributes
+ (mapcar (lambda (spec)
+ (find-attribute
+ description
+ (if (listp spec)
+ (car spec)
+ spec)))
+ attributes)
(description-attributes description))))))
function))))))))
-(defmacro with-described-object ((object description &rest args)
- &body body)
- `(funcall-with-described-object
- (lambda () ,@body)
- ,object
- ,description
- ,@args))
+
(defmacro define-description (name &optional superdescriptions &body options)
(let ((description-name (defining-description name)))