diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-09-05 15:38:46 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-09-08 13:09:37 -0700 |
commit | 210a2d70570792f8fac53960557232de910bff37 (patch) | |
tree | 4060cbe2298a02426b2df7c31507512c948a6c1e /src/property.lisp | |
parent | a41a42f86145909bafa1d7ce75a2ca3a9944e7fa (diff) | |
download | consfigurator-210a2d70570792f8fac53960557232de910bff37.tar.gz |
add dep on Anaphora and use APROG1, ALET & AAND in various places
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r-- | src/property.lisp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/property.lisp b/src/property.lisp index cf4fbb1..e846c46 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -105,10 +105,9 @@ (defun propapply (prop &rest args) (with-some-errors-are-failed-change - (let ((check (get prop 'check))) - (if (and check (apply check args)) - :no-change - (apply (get prop 'papply (constantly :no-change)) args))))) + (if (aand (get prop 'check) (apply it args)) + :no-change + (apply (get prop 'papply (constantly :no-change)) args)))) (defun propappapply (propapp) (if propapp @@ -452,18 +451,17 @@ You will usually be able to use DEFPROPLIST instead of DEFPROPSPEC. However, sometimes you will need to fall back on DEFPROPSPEC. For example, an unevaluated property application specification cannot express passing values other than constant values and propapps to property combinators." - (let ((propspec - (loop for remaining on properties - for car = (car remaining) - if (or (stringp car) - (and (listp car) - (member (car car) - '(:desc :check :hostattrs declare)))) - collect car into begin - else - return (nreverse - (cons `(props eseqprops ,@remaining) begin))))) - `(defpropspec ,name ,type ,lambda ,@propspec))) + (alet (loop for remaining on properties + for car = (car remaining) + if (or (stringp car) + (and (listp car) + (member (car car) + '(:desc :check :hostattrs declare)))) + collect car into begin + else + return (nreverse + (cons `(props eseqprops ,@remaining) begin))) + `(defpropspec ,name ,type ,lambda ,@it))) ;;;; hostattrs in property subroutines |