aboutsummaryrefslogtreecommitdiff
path: root/src/propspec.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-19 14:03:51 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-19 18:56:59 -0700
commit887003002331b2c27685319e902f748ce925f479 (patch)
tree6022b7022e748a3a18b91336dd3e68764dc19864 /src/propspec.lisp
parentd2e0d4c5a7b52fcca9c6e05c682433a86a67fcb8 (diff)
downloadconsfigurator-887003002331b2c27685319e902f748ce925f479.tar.gz
factor out WITH-SKIP-FAILED-CHANGES
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/propspec.lisp')
-rw-r--r--src/propspec.lisp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/propspec.lisp b/src/propspec.lisp
index 0c395dd..c0cec5c 100644
--- a/src/propspec.lisp
+++ b/src/propspec.lisp
@@ -277,6 +277,13 @@ expression."
(return-from ,name (list* psym args)))))
,@forms))))
+(defmacro with-skip-failed-changes (&body forms)
+ `(handler-bind ((failed-change
+ (lambda (c)
+ (declare (ignore c))
+ (invoke-restart 'skip-property))))
+ ,@forms))
+
(define-function-property-combinator eseqprops (&rest propapps)
(:retprop :type (collapse-types (mapcar #'propapptype propapps))
:check (constantly nil)
@@ -288,11 +295,7 @@ expression."
:check (constantly nil)
:hostattrs (lambda () (mapc #'propappattrs propapps))
:apply (lambda ()
- (handler-bind
- ((failed-change
- (lambda (c)
- (declare (ignore c))
- (invoke-restart 'skip-property))))
+ (with-skip-failed-changes
(apply-and-print propapps)))))
(defmacro with-requirements (propapp &body requirements)
@@ -306,11 +309,7 @@ apply the elements of REQUIREMENTS in reverse order."
:check (constantly nil)
:hostattrs (lambda () (mapc #'propappattrs propapps))
:apply (lambda ()
- (handler-bind
- ((failed-change
- (lambda (c)
- (declare (ignore c))
- (invoke-restart 'skip-property))))
+ (with-skip-failed-changes
(mapc #'propappapply propapps)))))
;; note that the :FAILED-CHANGE value is only used within this function and