From 533a4bd048e519b609f11499718fd9babeb07c4b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 4 May 2021 12:11:20 -0700 Subject: fix SILENT-SEQPROPS not reporting :NO-CHANGE Signed-off-by: Sean Whitton --- src/combinator.lisp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/combinator.lisp') 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 -- cgit v1.2.3