aboutsummaryrefslogtreecommitdiff
path: root/src/combinator.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-12-13 15:58:57 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-12-13 16:17:00 -0700
commiteda14d77dab39e05f69fef5fef2b5fb25482f215 (patch)
tree3cc600dd718b41d224ac2f0e7905145c53079185 /src/combinator.lisp
parent96363fc7741377ff40133c2656ebd93025a48a81 (diff)
downloadconsfigurator-eda14d77dab39e05f69fef5fef2b5fb25482f215.tar.gz
rename combinator UNAPPLY->UNAPPLIED and add new UNAPPLY macro
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/combinator.lisp')
-rw-r--r--src/combinator.lisp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/combinator.lisp b/src/combinator.lisp
index 088d3cd..aad9b99 100644
--- a/src/combinator.lisp
+++ b/src/combinator.lisp
@@ -230,12 +230,19 @@ apply the elements of REQUIREMENTS in reverse order."
(post-apply "failed"))
(setf (fill-pointer buffer) 0)))))
-(define-function-property-combinator unapply (propapp)
+(defmacro unapply (form)
+ "Where FORM is a programmatic application of a property (i.e. an application
+of a property directly inside an :APPLY or :UNAPPLY subroutine), unapply the
+property instead of applying it."
+ (destructuring-bind (property . args) form
+ `(consfigure `(unapplied (,',property ,,@args)))))
+
+(define-function-property-combinator unapplied (propapp)
(destructuring-bind (psym . args) propapp
(:retprop :type (proptype psym)
:lambda (proplambda psym)
:desc (lambda (&rest args)
- (strcat "Unapply: " (apply #'propdesc psym args)))
+ (strcat "Unapplied: " (apply #'propdesc psym args)))
:check (when-let ((check (get psym 'check)))
(complement check))
:hostattrs (lambda (&rest args)
@@ -353,7 +360,7 @@ an :UNAPPLY subroutine for a property which works by calling other properties."
(:retprop :type (collapse-propapp-types apply (cdr unapply))
:hostattrs (lambda-ignoring-args
(propappattrs apply-propapp)
- ;; as in definition of UNAPPLY combinator
+ ;; as in definition of UNAPPLIED combinator
(with-preserve-hostattrs
(propappattrs unapply-propapp)))
:apply (lambda-ignoring-args (propappapply apply-propapp))