Adjust reference PRINT-OBJECTs to not error on unbound slots
This commit is contained in:
parent
3c8835eb7b
commit
57c2978b71
1 changed files with 9 additions and 2 deletions
|
@ -13,7 +13,9 @@
|
|||
|
||||
(defmethod print-object ((object reference-constant) stream)
|
||||
(print-unreadable-object (object stream :type t)
|
||||
(format stream "~D" (ref-value object))))
|
||||
(format stream "~A" (if (slot-boundp object '%value)
|
||||
(ref-value object)
|
||||
"?"))))
|
||||
|
||||
(defmethod ref= ((a reference-constant) (b reference-constant))
|
||||
(= (value a) (value b)))
|
||||
|
@ -23,4 +25,9 @@
|
|||
|
||||
(defmethod print-object ((object reference-variable) stream)
|
||||
(print-unreadable-object (object stream :type t)
|
||||
(format stream "@~D" (ref-index object))))
|
||||
(when (slot-boundp object '%name)
|
||||
(write-string (name object) stream))
|
||||
(when (and (slot-boundp object '%name) (slot-boundp object '%index))
|
||||
(write-string " " stream))
|
||||
(when (slot-boundp object '%index)
|
||||
(format stream "@~A" (ref-index object)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue