Add PRINT-OBJECT method to TOKEN-NUMBER

This commit is contained in:
John Lorentzson 2025-05-22 13:03:27 +02:00
parent 12d1a905fe
commit 3f3d94367f

View file

@ -43,6 +43,11 @@ reading immediately. Should be a subset of *SPECIAL-TOKEN-CHARS*.")
(defclass token-number (token)
((%value :accessor value :initarg :value)))
(defmethod print-object ((object token-number) stream)
(print-unreadable-object (object stream :type t :identity t)
(when (slot-boundp object '%value)
(format stream "~D" (value object)))))
(define-transformation (token (token-number reference-constant))
(make-instance 'reference-constant :value (value token)))