aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-04-05 10:27:33 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-04-05 10:27:33 -0700
commit8a4ed49fb7625793096842ce2ebe72b64da80f9b (patch)
tree30cb823e6e7891421339f73fc9ce9de11ff1497b
parenta43042f379b78489cca16759d9afca7152e3c310 (diff)
downloadconsfigurator-8a4ed49fb7625793096842ce2ebe72b64da80f9b.tar.gz
add DESC combinator
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/combinator.lisp13
-rw-r--r--src/package.lisp1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/combinator.lisp b/src/combinator.lisp
index a133c2b..a67bba8 100644
--- a/src/combinator.lisp
+++ b/src/combinator.lisp
@@ -149,6 +149,19 @@ apply the elements of REQUIREMENTS in reverse order."
:unapply (get psym 'papply)
:args args)))
+(define-function-property-combinator desc (desc propapp)
+ (:retprop :type (propapptype propapp)
+ :desc (lambda () desc)
+ :hostattrs (lambda (&rest args)
+ (declare (ignore args))
+ (propappattrs propapp))
+ :apply (lambda (&rest args)
+ (declare (ignore args))
+ (propappapply propapp))
+ :unapply (lambda (&rest args)
+ (declare (ignore args))
+ (propappunapply propapp))))
+
(defmacro on-change (propapp &body on-change)
"If applying PROPAPP makes a change, also apply each of of the propapps
ON-CHANGE in order."
diff --git a/src/package.lisp b/src/package.lisp
index 388b7d0..87c61e7 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -151,6 +151,7 @@
#:with-requirements
#:silent-seqprops
#:unapply
+ #:desc
#:on-change
#:as