diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-03-12 14:56:34 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-03-12 14:56:34 -0700 |
commit | 2b89cfb8645afb249f6cc21fe3ae588dae5210be (patch) | |
tree | d67961d7a112b96dea9f46bf32034f69a6405acf /src/util.lisp | |
parent | 2d8291f14de90fcf8ad09bcc175b5fcdaaf91531 (diff) | |
download | consfigurator-2b89cfb8645afb249f6cc21fe3ae588dae5210be.tar.gz |
rename DEFINE-PRINT-OBJECT-FOR-STRUCTLIKE & REINIT-STRUCTLIKE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/util.lisp')
-rw-r--r-- | src/util.lisp | 10 |
1 files changed, 5 insertions, 5 deletions
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)) |