aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-24 10:06:05 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-24 10:06:05 -0700
commitac17e28f7d927cad8884b33e66c47abaab8f85e3 (patch)
treede1a64e3b70e5e13c92db529be1cbcad734fc48a
parentf789ae57f132fb46fd26adcc920ef0110322c0f9 (diff)
downloadconsfigurator-ac17e28f7d927cad8884b33e66c47abaab8f85e3.tar.gz
define PRINT-OBJECT methods sufficient to readably print *HOST*
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/host.lisp7
-rw-r--r--src/propspec.lisp7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/host.lisp b/src/host.lisp
index 2ef0fb6..a8c3b72 100644
--- a/src/host.lisp
+++ b/src/host.lisp
@@ -28,6 +28,13 @@
:documentation "Property application specification of the properties to
be applied to the host.")))
+(defmethod print-object ((host host) stream)
+ (format stream "~S" `(make-instance
+ 'host
+ :attrs ',(slot-value host 'hostattrs)
+ :props ,(slot-value host 'propspec)))
+ host)
+
(defmacro defhost (hostname &body properties)
"Define a host with hostname HOSTNAME and properties PROPERTIES.
HOSTNAME can be a string or a symbol. In either case, the host will get a
diff --git a/src/propspec.lisp b/src/propspec.lisp
index 59e7cea..b46b6b5 100644
--- a/src/propspec.lisp
+++ b/src/propspec.lisp
@@ -77,6 +77,13 @@ systems, resolve unapply, onchange etc., and then look in the value cell of
each PROPERTY to find a property, and pass each of ARGS to the function in the
property's apply slot."))
+(defmethod print-object ((propspec propspec) stream)
+ (format stream "~S" `(make-instance
+ 'propspec
+ :systems ',(slot-value propspec 'systems)
+ :props ',(slot-value propspec 'applications)))
+ propspec)
+
;; The following five functions, should be everything we need to do with
;; propspecs, so all knowledge of the possible combinator symbols should be
;; confined to these four functions -- i.e., if we are to add any combinators,