added ROFL test cases + extra formatting hooks for attributes
[clinton/lisp-on-lines.git] / src / standard-descriptions / inline.lisp
dissimilarity index 67%
index 9d05b65..b620fcd 100644 (file)
@@ -1,16 +1,19 @@
-(in-package :lisp-on-lines)
-
-(define-description inline ())
-
-(define-description t ()
-  ((identity :label nil)
-   (active-attributes :value (identity)))
-  (:in-description inline))
-
-(define-display :in-description inline ((description t))
-  (format *display* "~{~A ~}" 
-         (mapcar 
-          (lambda (attribute)
-            (with-output-to-string (*display*)
-              (display-attribute *object* attribute)))
-          (attributes description))))
+(in-package :lisp-on-lines)
+
+(define-description inline ())
+
+(define-description t ()
+  ((identity :label nil)
+   (active-attributes :value '(identity))
+   (attribute-delimiter :value ", ")
+   (label-formatter :value (curry #'format nil "~A: "))
+   (value-formatter :value (curry #'format nil "~A")))
+  (:in-description inline))
+
+(define-layered-class standard-attribute
+  :in-layer #.(defining-description 'inline)
+  ()
+  ())
+
+(define-display :in-description inline ((description t))               
+               (call-next-method))