X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/e7c5f95a989882cabc1f4b6ea4598565ea317952..079b90842fc99823554991ff3e739da9a5d42d97:/src/attribute.lisp diff --git a/src/attribute.lisp b/src/attribute.lisp index 2e3877e..32279fe 100644 --- a/src/attribute.lisp +++ b/src/attribute.lisp @@ -10,11 +10,9 @@ (defmethod eval-attribute-initarg (attribute (initarg (eql :function))) t) - (define-layered-function attribute-value (object attribute)) -(define-layered-method attribute-value (object attribute) - (funcall (attribute-function attribute) object)) + (deflayer LISP-ON-LINES) (ensure-active-layer 'lisp-on-lines) @@ -30,7 +28,8 @@ (initargs)) (defmethod shared-initialize :around ((instance attribute-special-layered-direct-slot-definition) slots &rest initargs ) - (setf (slot-value instance 'initargs) (apply #'arnesi:remove-keywords initargs *standard-direct-slot-initarg-symbols*)) + (setf (slot-value instance 'initargs) + (apply #'arnesi:remove-keywords initargs *standard-direct-slot-initarg-symbols*)) (call-next-method)) (define-layered-class standard-attribute @@ -51,6 +50,11 @@ :initarg :value :layered t))) +(define-layered-method attribute-value (object attribute) + (funcall (attribute-function attribute) object)) + + + (defmethod shared-initialize :around ((attribute standard-attribute) slots &rest initargs) (declare (ignore initargs)) (setf (attribute-function attribute) @@ -74,7 +78,7 @@ ((attribute standard-attribute) display object &rest args) (declare (ignore args)) (format display "~@[~A ~]~A" (attribute-label attribute) - (display display (attribute-value object attribute)))) + (attribute-value object attribute)))