1 (in-package :lisp-on-lines
)
4 (define-description editable
()
8 (define-description T
()
9 ((editp :label
"Edit by Default?"
15 (:in-description editable
))
17 (define-layered-function (setf attribute-value
) (v o a
)
18 (:method
(value object attribute
)
19 (let ((setter (attribute-setter attribute
)))
21 (funcall setter value object
)
22 (error "No setter in ~A for ~A" attribute object
)))))
24 (define-layered-class standard-attribute
25 :in-layer
#.
(defining-description 'editable
)
29 :accessor %attribute-editp
35 :accessor attribute-setter
38 (define-layered-function attribute-editp
(object attribute
)
39 (:method
(object attribute
) nil
))
41 (define-layered-method attribute-editp
42 :in-layer
#.
(defining-description 'editable
)
43 (object (attribute standard-attribute
))
45 (if (eq :inherit
(%attribute-editp attribute
))
46 (attribute-value object
(find-attribute
47 (attribute-description attribute
)
49 (%attribute-editp attribute
)))
52 (define-layered-method display-using-description
53 :in-layer
#.
(defining-description 'editable
)
54 ((attribute standard-attribute
) display object
&rest args
)
56 (declare (ignore args
))
57 (format t
"Editable? ~A ~A" (attribute-label attribute
) (attribute-editp object attribute
)))