4358148e |
1 | (in-package :lisp-on-lines) |
2 | |
2548f054 |
3 | |
4 | (define-layered-class list-attribute (standard-attribute) |
5 | ((item-args :initform nil :initarg :item :layered t :special t))) |
6 | |
7 | (define-layered-method display-attribute-value |
8 | ((attribute list-attribute)) |
9 | (arnesi:dolist* (item (attribute-value attribute)) |
10 | (apply #'display *display* item (slot-value attribute 'item-args)))) |
11 | |
12 | (define-description list () |
13 | ((list :attribute-class list-attribute |
14 | :function #'identity |
15 | :attributes nil))) |
16 | |
17 | (define-description cons (list) |
4358148e |
18 | ((car :label "First" :function #'car) |
2548f054 |
19 | (cdr :label "Rest" :function #'cdr) |
20 | )) |
4358148e |
21 | |
22 | (define-description cons () |
23 | ((editp :value t :editp nil) |
24 | (car :setter #'rplaca) |
25 | (cdr :setter #'rplacd)) |
26 | (:in-description editable)) |
27 | |
2548f054 |
28 | (define-description cons () |
29 | ((active-attributes :value '(list))) |
30 | (:in-description inline)) |
31 | |
4358148e |
32 | (define-layered-method description-of ((c cons)) |
33 | (find-description 'cons)) |
34 | |
35 | |
36 | |
37 | |
38 | |
39 | |