From ea9a5cb47d2915d5e527d85c6a49998f9d51dff6 Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Wed, 14 Feb 1990 12:46:09 +0000
Subject: [PATCH] Changed DEFSTRUCT expansion to only use #' on non-symbol
 PRINT-FUNCTIONS, so that named print functions can be defined after the
 structure.

---
 code/defstruct.lisp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/code/defstruct.lisp b/code/defstruct.lisp
index 60d094e40..7b50faea4 100644
--- a/code/defstruct.lisp
+++ b/code/defstruct.lisp
@@ -68,9 +68,12 @@
 	   ;; So the print function is in the right lexical environment, and
 	   ;; can be compiled...
 	   (let ((new ',defstruct))
-	     ,@(when (dd-print-function defstruct)
-		 `((setf (info type printer ',name)
-			 #',(dd-print-function defstruct))))
+	     ,@(let ((pf (dd-print-function defstruct)))
+		 (when pf
+		   `((setf (info type printer ',name)
+			   ,(if (symbolp pf)
+				`',pf
+				`#',pf)))))
 	     (%defstruct new))
 	   ',name)
 	`(progn
-- 
GitLab