aboutsummaryrefslogtreecommitdiff
path: root/src/combinator.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-04 12:11:20 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-06 12:23:51 -0700
commit533a4bd048e519b609f11499718fd9babeb07c4b (patch)
tree993561e96497838d494c15d4aca56992d0dc6540 /src/combinator.lisp
parent960743cf9ce4948a9ea6f7e3a93b4beaf74ceb13 (diff)
downloadconsfigurator-533a4bd048e519b609f11499718fd9babeb07c4b.tar.gz
fix SILENT-SEQPROPS not reporting :NO-CHANGE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/combinator.lisp')
-rw-r--r--src/combinator.lisp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/combinator.lisp b/src/combinator.lisp
index 902fa60..02e558c 100644
--- a/src/combinator.lisp
+++ b/src/combinator.lisp
@@ -89,14 +89,20 @@ apply the elements of REQUIREMENTS in reverse order."
`(eseqprops ,@(reverse requirements) ,propapp))
(define-function-property-combinator silent-seqprops (&rest propapps)
- (:retprop :type (collapse-types (mapcar #'propapptype propapps))
- :hostattrs (lambda () (mapc #'propappattrs propapps))
- :apply (lambda ()
- (with-skip-failed-changes
- (mapc #'propappapply propapps)))
- :unapply (lambda ()
- (with-skip-failed-changes
- (mapc #'propappunapply (reverse propapps))))))
+ (flet ((gather-results (op propapps)
+ (with-skip-failed-changes
+ (let ((return-value :no-change))
+ (dolist (propapp propapps return-value)
+ (let ((result (funcall op propapp)))
+ (unless (eql result :no-change)
+ (setq return-value result))))))))
+ (:retprop :type (collapse-types (mapcar #'propapptype propapps))
+ :hostattrs (lambda () (mapc #'propappattrs propapps))
+ :apply (lambda ()
+ (gather-results #'propappapply propapps))
+ :unapply (lambda ()
+ (gather-results #'propappunapply
+ (reverse propapps))))))
;; note that the :FAILED-CHANGE value is only used within this function and
;; should not be returned by property subroutines, per the spec