From 2b89cfb8645afb249f6cc21fe3ae588dae5210be Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 12 Mar 2022 14:56:34 -0700 Subject: rename DEFINE-PRINT-OBJECT-FOR-STRUCTLIKE & REINIT-STRUCTLIKE Signed-off-by: Sean Whitton --- src/connection.lisp | 2 +- src/host.lisp | 2 +- src/image.lisp | 2 +- src/package.lisp | 2 +- src/property/disk.lisp | 2 +- src/property/lets-encrypt.lisp | 2 +- src/property/os.lisp | 4 ++-- src/propspec.lisp | 4 ++-- src/util.lisp | 10 +++++----- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/connection.lisp b/src/connection.lisp index a6c9fdc..7cefb6c 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -69,7 +69,7 @@ For an example of usage, see the :SUDO connection type.")) :initform nil :documentation "This connection's connection attributes."))) -(define-print-object-for-structlike connection) +(define-simple-print-object connection) (defclass lisp-connection (connection) ()) diff --git a/src/host.lisp b/src/host.lisp index 395728b..979ab8c 100644 --- a/src/host.lisp +++ b/src/host.lisp @@ -115,7 +115,7 @@ Called by properties which set up such subhosts, like CHROOT:OS-BOOTSTRAPPED." (make-instance 'unpreprocessed-host :propspec propspec :hostattrs hostattrs*))) -(define-print-object-for-structlike host) +(define-simple-print-object host) (defmethod union-propspec-into-host ((host unpreprocessed-host) (propspec propspec)) diff --git a/src/image.lisp b/src/image.lisp index b57350d..76c2fd0 100644 --- a/src/image.lisp +++ b/src/image.lisp @@ -619,5 +619,5 @@ hostattrs; see \"Pitfalls\" in the Consfigurator user manual. If ~:*~A is a simple object then you may be able to resolve this by defining a PRINT-OBJECT method for your class, possibly using -CONSFIGURATOR:DEFINE-PRINT-OBJECT-FOR-STRUCTLIKE." +CONSFIGURATOR:DEFINE-SIMPLE-PRINT-OBJECT." (print-not-readable-object c)))))))) diff --git a/src/package.lisp b/src/package.lisp index 676ea3b..6197c12 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -114,7 +114,7 @@ #:local-directory-contents #:ensure-trailing-slash #:drop-trailing-slash - #:define-print-object-for-structlike + #:define-simple-print-object #:chroot-pathname #:in-chroot-pathname #:sh-escape diff --git a/src/property/disk.lisp b/src/property/disk.lisp index 351ae86..167f1f2 100644 --- a/src/property/disk.lisp +++ b/src/property/disk.lisp @@ -63,7 +63,7 @@ slot bound.")) (:documentation "Something which contains filesystems and/or other volumes.")) -(define-print-object-for-structlike volume) +(define-simple-print-object volume) (defgeneric copy-volume-and-contents (volume &rest initialisations &key &allow-other-keys) diff --git a/src/property/lets-encrypt.lisp b/src/property/lets-encrypt.lisp index 4ac82a3..1e90248 100644 --- a/src/property/lets-encrypt.lisp +++ b/src/property/lets-encrypt.lisp @@ -32,7 +32,7 @@ Let's Encrypt client. Supply an e-mail address so that Let's Encrypt can contact you for things like certificate expiry, planned outage notifications etc.")) -(define-print-object-for-structlike agree-tos) +(define-simple-print-object agree-tos) (defmacro agree-tos (&key (email-address nil email-address-supplied-p)) `(make-instance 'agree-tos ,@(and email-address-supplied-p diff --git a/src/property/os.lisp b/src/property/os.lisp index e9a9d8e..c4da923 100644 --- a/src/property/os.lisp +++ b/src/property/os.lisp @@ -32,7 +32,7 @@ (:desc "Host kernel is Linux") (:hostattrs (push-hostattrs :os (make-instance 'linux :arch architecture)))) -(define-print-object-for-structlike linux) +(define-simple-print-object linux) (defclass debianlike (linux) ()) @@ -41,7 +41,7 @@ :reader debian-suite :initform (error "Must provide suite")))) -(define-print-object-for-structlike debian) +(define-simple-print-object debian) (defclass debian-stable (debian) ()) diff --git a/src/propspec.lisp b/src/propspec.lisp index 0bbf12a..b876830 100644 --- a/src/propspec.lisp +++ b/src/propspec.lisp @@ -197,9 +197,9 @@ systems." :systems systems :propspec propspec) (make-instance 'unpreprocessed-propspec :propspec propspec))) -(define-print-object-for-structlike preprocessed-propspec) +(define-simple-print-object preprocessed-propspec) -(define-print-object-for-structlike unpreprocessed-propspec) +(define-simple-print-object unpreprocessed-propspec) ;; this could be defined for preprocessed propspecs easily enough but we ;; shouldn't need to append those diff --git a/src/util.lisp b/src/util.lisp index ca8e3e3..aefe01c 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -227,7 +227,7 @@ symlinks. Not suitable for use by :POSIX properties." (subseq namestring 0 (1- (length namestring))) namestring)) -(defun reinit-structlike (class &rest slots) +(defun reinit-from-simple-print (class &rest slots) (loop with object = (allocate-instance (find-class class)) for (slot-name slot-value) on slots by #'cddr do (setf (slot-value object slot-name) slot-value) @@ -238,14 +238,14 @@ symlinks. Not suitable for use by :POSIX properties." `(if (member (type-of ,x) '(cons symbol)) `',,x ,x))) -(defmacro define-print-object-for-structlike (class) - "Define an implementation of PRINT-OBJECT for objects which are simple -one-dimensional collections of values." +(defmacro define-simple-print-object (class) + "Define an implementation of PRINT-OBJECT suitable for classes representing +simple collections of readably-printable values." `(defmethod print-object ((object ,class) stream) (if (and *print-readably* *read-eval*) (format stream "#.~S" - `(reinit-structlike + `(reinit-from-simple-print ',(type-of object) ;; Call CLASS-OF so that subclasses of CLASS are handled too. ,@(loop for slot in (closer-mop:class-slots (class-of object)) -- cgit v1.2.3