diff --git a/code/defstruct.lisp b/code/defstruct.lisp
index 60d094e40d8cf289ac1e250a73ceb2dc0ab405c5..7b50faea46a4d638e43d61c5c7960559a9436271 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