added ROFL test cases + extra formatting hooks for attributes
[clinton/lisp-on-lines.git] / src / standard-descriptions / edit.lisp
index d4a913e..0033502 100644 (file)
    (class :editp nil))
   (:in-description editable))
 
-(define-layered-function (setf attribute-value) (v o a)
-  (:method (value object attribute)
-    (let ((setter (attribute-setter attribute)))
-      (if setter
-         (funcall setter value object)
-         (error "No setter in ~A for ~A" attribute object)))))
+(define-layered-method (setf attribute-value-using-object)
+ :in-layer #.(defining-description 'editable)(value object attribute)
+
+ (let ((setter (attribute-setter attribute)))
+   (if setter
+       (funcall setter value object)
+       (error "No setter in ~A for ~A" attribute object))))
 
 (define-layered-class standard-attribute
   :in-layer #.(defining-description 'editable)
@@ -43,9 +44,9 @@
   (object (attribute standard-attribute))
                       
   (if (eq :inherit (%attribute-editp attribute))
-      (attribute-value object (find-attribute 
-                              (attribute-description attribute) 
-                              'editp))
+      (attribute-value (find-attribute 
+                       (attribute-description attribute) 
+                       'editp))
       (%attribute-editp attribute)))
                       
 
@@ -54,7 +55,9 @@
   ((attribute standard-attribute) display object &rest args)
   
   (declare (ignore args))
-  (format t "Editabpe? ~A ~A" (attribute-label attribute) attribute))
+  (if (attribute-editp object attribute)
+      (format *display* "This is where we'd edit")
+      (call-next-method)))
 
 
                       
\ No newline at end of file