print-object: when printing the standard object print its address

Now instead of a default printer #<a foo> we have the identity
information #<a foo 0x56123571d240>. That is certainly useful for
printing when we have lists of instances of the same class.
This commit is contained in:
Daniel Kochmański 2020-04-05 14:15:34 +02:00
parent 3891bcc76b
commit f532057a83

View file

@ -193,7 +193,7 @@ printer and we should rather use MAKE-LOAD-FORM."
instance)
(defmethod print-object ((instance standard-object) stream)
(print-unreadable-object (instance stream)
(print-unreadable-object (instance stream :identity t)
(let ((*package* (find-package "CL")))
(format stream "a ~S"
(class-name (si:instance-class instance)))))