aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-28 16:53:03 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-28 16:53:03 -0700
commitcb87eeb259ab50cbb136b08516cee49d7b20e240 (patch)
tree8f8e4a24b02a8f67809be482ea3555534efc2444
parent12aa5bf3dcd2ee160036ef8d7f5302198f1a9371 (diff)
downloadconsfigurator-cb87eeb259ab50cbb136b08516cee49d7b20e240.tar.gz
default the SYSTEMS slot of propspecs whenever they are initialised
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/propspec.lisp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/propspec.lisp b/src/propspec.lisp
index f2ca2e9..262c147 100644
--- a/src/propspec.lisp
+++ b/src/propspec.lisp
@@ -44,6 +44,9 @@ Consfigurator properties code in this symbol's package applies to hosts."))))
(defclass propspec ()
((systems
:initarg :systems
+ :initform (or (symbol-value (find-symbol "*CONSFIG*"))
+ (error
+ "Looks like *CONSFIG* is not set; please call IN-CONSFIG"))
:reader propspec-systems
:documentation "List of names of systems, the loading of all of which is
sufficient to deploy this propspec.")
@@ -169,10 +172,7 @@ an atomic property application."
return :lisp
finally (return :posix)))
-(defun props (forms
- &optional
- (systems (symbol-value (find-symbol "*CONSFIG*"))
- systems-supplied-p))
+(defun props (forms &optional (systems nil systems-supplied-p))
"Where FORMS is the elements of an unevaluated property application
specification, return code which will evaluate the expressions and produce the
corresponding property application specification.
@@ -183,8 +183,6 @@ that the returned code should produce.
Intended for use by macros which allow the user to provide expressions instead
of values as the arguments to properties when building a property application
specification."
- (unless (or systems systems-supplied-p)
- (error "Looks like *CONSFIG* is not set; please call IN-CONSFIG"))
(labels ((make-eval-propspec (form)
(if (atom form)
`(quote ,form)
@@ -197,7 +195,7 @@ specification."
`(list ,@(mapcar #'make-eval-propspec form)))))))
`(make-instance
'propspec
- :systems ',systems
+ ,@(and systems-supplied-p `(:systems ,systems))
:props (list ,@(mapcar #'make-eval-propspec forms)))))
(defmethod append-propspecs ((first propspec) (second propspec))