From: drewc Date: Thu, 28 Aug 2008 20:16:32 +0000 (-0700) Subject: Added NULL description and added :when option for attribute active X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/commitdiff_plain/c29b2d2dda5ab82f7458666c154094693bfe9f1b?hp=bd9c9c317657fe4d4cd1b7b4758f36b0f338ef3c Added NULL description and added :when option for attribute active darcs-hash:20080828201632-39164-a2a9ccf0c2e99f36046543911b7158bb276c9e73.gz --- 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))