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-method (setf attribute-value-using-object
)
18 :in-layer
#.
(defining-description 'editable
)(value object attribute
)
20 (let ((setter (attribute-setter attribute
)))
22 (funcall setter value object
)
23 (error "No setter in ~A for ~A" attribute object
))))
25 (define-layered-class standard-attribute
26 :in-layer
#.
(defining-description 'editable
)
30 :accessor %attribute-editp
36 :accessor attribute-setter
39 (define-layered-function attribute-editp
(object attribute
)
40 (:method
(object attribute
) nil
))
42 (define-layered-method attribute-editp
43 :in-layer
#.
(defining-description 'editable
)
44 (object (attribute standard-attribute
))
46 (if (eq :inherit
(%attribute-editp attribute
))
47 (attribute-value (find-attribute
48 (attribute-description attribute
)
50 (%attribute-editp attribute
)))
53 (define-layered-method display-using-description
54 :in-layer
#.
(defining-description 'editable
)
55 ((attribute standard-attribute
) display object
&rest args
)
57 (declare (ignore args
))
58 (if (attribute-editp object attribute
)
59 (format *display
* "This is where we'd edit")