aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-04-05 10:43:19 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-04-05 11:14:26 -0700
commitd60073bace57dbc13e295f40d39d73092844c08c (patch)
treef57d0b3591d528303e22c8c739de3a3c6d638ee0 /src
parent5ffde74ed2e5116e43e8b04c382d17722231512b (diff)
downloadconsfigurator-d60073bace57dbc13e295f40d39d73092844c08c.tar.gz
the empty list is now a valid propapp
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src')
-rw-r--r--src/combinator.lisp13
-rw-r--r--src/package.lisp1
-rw-r--r--src/property.lisp20
-rw-r--r--src/property/os.lisp2
4 files changed, 21 insertions, 15 deletions
diff --git a/src/combinator.lisp b/src/combinator.lisp
index a67bba8..f782367 100644
--- a/src/combinator.lisp
+++ b/src/combinator.lisp
@@ -20,11 +20,6 @@
;;;; Property combinators
-(defprop noop :posix (&rest args)
- "A property which accepts any number of arguments and does nothing."
- (:desc (declare (ignore args)) "No-op property")
- (:hostattrs (declare (ignore args))))
-
(defmacro define-function-property-combinator (name args &body body)
(multiple-value-bind (forms declarations docstring)
(parse-body body :documentation t)
@@ -107,8 +102,12 @@ apply the elements of REQUIREMENTS in reverse order."
;; should not be returned by property subroutines, per the spec
(defun apply-and-print (propapps &optional unapply)
(flet ((paa (pa) (if unapply (propappunapply pa) (propappapply pa))))
- (let ((ret :no-change))
- (dolist (pa (if unapply (reverse propapps) propapps) ret)
+ (let ((ret :no-change)
+ ;; Remove any null propapps because we don't want to print anything
+ ;; for those, and applying them will do nothing.
+ (propapps
+ (remove-if #'null (if unapply (reverse propapps) propapps))))
+ (dolist (pa propapps ret)
(let* ((announce (not (get (get (car pa) 'combinator)
'inline-combinator)))
;; TODO Nested combinators can mean that we establish this
diff --git a/src/package.lisp b/src/package.lisp
index 111312a..fd6ec12 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -143,7 +143,6 @@
#:append-propspecs
;; combinator.lisp
- #:noop
#:define-function-property-combinator
#:define-choosing-property-combinator
#:seqprops
diff --git a/src/property.lisp b/src/property.lisp
index 175f7dd..33b9e71 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -59,7 +59,9 @@
(get prop 'preprocess (lambda (&rest args) args)))
(defun propapptype (propapp)
- (get (car propapp) 'ptype))
+ (if propapp
+ (get (car propapp) 'ptype)
+ :posix))
(defun collapse-types (&rest lists)
(if (member :posix (flatten lists)) :posix :lisp))
@@ -68,7 +70,8 @@
(apply (get prop 'desc #'noop) args))
(defun propappdesc (propapp)
- (apply #'propdesc propapp))
+ (when propapp
+ (apply #'propdesc propapp)))
(defun proplambda (prop)
(get prop 'plambda))
@@ -77,13 +80,14 @@
(apply (get prop 'hostattrs #'noop) args))
(defun propappattrs (propapp)
- (apply #'propattrs propapp))
+ (when propapp
+ (apply #'propattrs propapp)))
(defun propcheck (prop &rest args)
(apply (get prop 'check #'noop) args))
(defun propappcheck (propapp)
- (apply #'propcheck propapp))
+ (if propapp (apply #'propcheck propapp) t))
(defmacro with-some-errors-are-failed-change (&body forms)
`(handler-case (progn ,@forms)
@@ -98,7 +102,9 @@
(apply (get prop 'papply (constantly :no-change)) args)))))
(defun propappapply (propapp)
- (apply #'propapply propapp))
+ (if propapp
+ (apply #'propapply propapp)
+ :no-change))
(defun propunapply (prop &rest args)
(with-some-errors-are-failed-change
@@ -108,7 +114,9 @@
(apply (get prop 'unapply (constantly :no-change)) args)))))
(defun propappunapply (propapp)
- (apply #'propappunapply propapp))
+ (if propapp
+ (apply #'propappunapply propapp)
+ :no-change))
(defvar *known-properties* nil
"All properties whose definitions have been loaded.")
diff --git a/src/property/os.lisp b/src/property/os.lisp
index d1aeb2b..aceb24e 100644
--- a/src/property/os.lisp
+++ b/src/property/os.lisp
@@ -99,7 +99,7 @@
(define-choosing-property-combinator os-typecase* (host &rest cases)
:type (typecase-type cases)
- :choose (or (typecase-choose host cases) '(noop)))
+ :choose (typecase-choose host cases))
(define-choosing-property-combinator os-etypecase* (host &rest cases)
:type (typecase-type cases)