From c29b2d2dda5ab82f7458666c154094693bfe9f1b Mon Sep 17 00:00:00 2001 From: drewc Date: Thu, 28 Aug 2008 13:16:32 -0700 Subject: [PATCH] Added NULL description and added :when option for attribute active darcs-hash:20080828201632-39164-a2a9ccf0c2e99f36046543911b7158bb276c9e73.gz --- lisp-on-lines.asd | 10 ++++++---- src/attribute.lisp | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp-on-lines.asd b/lisp-on-lines.asd index 0e32bf7..f4af77b 100644 --- a/lisp-on-lines.asd +++ b/lisp-on-lines.asd @@ -60,7 +60,9 @@ OTHER DEALINGS IN THE SOFTWARE." (:file "edit") (:file "symbol") (:file "list") - (:file "clos")) + (:file "null") + (:file "clos") + ) :serial t)) @@ -68,9 +70,9 @@ OTHER DEALINGS IN THE SOFTWARE." :serial t :depends-on (:contextl :arnesi :alexandria :parse-number ;;for rofl: - :cl-postgres :simple-date :postmodern)) - - + :cl-postgres + :simple-date-postgres + :postmodern )) (defsystem :lisp-on-lines.test diff --git a/src/attribute.lisp b/src/attribute.lisp index 210b36d..d332f60 100644 --- a/src/attribute.lisp +++ b/src/attribute.lisp @@ -134,6 +134,12 @@ :layered t :special t))) +(define-layered-method attribute-active-p :around (attribute) + (let ((active? (call-next-method))) + (if (eq :when active?) + (not (null (attribute-value attribute))) + active?))) + (define-layered-method attribute-label-formatter :around (attribute) (or (slot-value attribute 'label-formatter) (attribute-value (find-attribute (attribute-description attribute) 'label-formatter)) -- 2.20.1