| 1 | (in-package :lisp-on-lines) |
| 2 | |
| 3 | (define-description T () |
| 4 | ((identity :label nil :function #'identity) |
| 5 | (type :label "Type" :function #'type-of) |
| 6 | (class :label "Class" :function #'class-of) |
| 7 | (active-attributes :label "Attributes" |
| 8 | :value nil |
| 9 | :activep nil |
| 10 | :keyword :attributes))) |
| 11 | |
| 12 | (define-layered-method description-of (any-lisp-object) |
| 13 | (find-description 't)) |
| 14 | |
| 15 | (define-display ((description t)) |
| 16 | (format *display* "~{~A~%~}" |
| 17 | (mapcar |
| 18 | (lambda (attribute) |
| 19 | (with-output-to-string (*display*) |
| 20 | (display-attribute *object* attribute))) |
| 21 | (attributes description)))) |
| 22 | |
| 23 | |
| 24 | |