From df0e39f596cbdc388f86fe707e32480544377d2c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 29 Oct 2021 15:11:24 -0700 Subject: ON{-APPLY,}-CHANGE: always return result of primary propapp In particular, if the secondary propapps are applied but make no change, do not return :NO-CHANGE as the overall result. Signed-off-by: Sean Whitton --- src/combinator.lisp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/combinator.lisp') diff --git a/src/combinator.lisp b/src/combinator.lisp index 772ac6c..26a6767 100644 --- a/src/combinator.lisp +++ b/src/combinator.lisp @@ -286,14 +286,13 @@ in order." (apply #'propattrs prop args) (propappattrs on-change)) :apply (lambda (&rest args) - (if (eql :no-change (apply #'propapply prop args)) - :no-change - (propappapply on-change))) + (aprog1 (apply #'propapply prop args) + (unless (eql it :no-change) + (propappapply on-change)))) :unapply (lambda (&rest args) - (let ((result (apply #'propunapply prop args))) - (cond ((eql :no-change result) :no-change) - (unapply (propappapply on-change)) - (t result)))) + (aprog1 (apply #'propunapply prop args) + (when (and unapply (not (eql it :no-change))) + (propappapply on-change)))) :args (cdr propapp)))) (defmacro as (user &body properties) -- cgit v1.2.3