Last active
April 5, 2019 11:12
-
-
Save cbaggers/5cea7e636090b6ad1a4a8ec19bfac6d4 to your computer and use it in GitHub Desktop.
Making circular list in print-object fails to print even when *print-circle* is T
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(setf *print-circle* t)) | |
#|| | |
How to trigger issue: | |
First run (make-instance 'trigger-object) to see the overflow. | |
Then run (make-circular) to see that the list created in print-object | |
should have been printable. | |
||# | |
(defclass trigger-object () ()) | |
(defun make-circular () | |
(let ((thing (make-list 3))) | |
(setf (second thing) thing | |
(third thing) thing) | |
thing)) | |
(defmethod print-object ((obj trigger-object) stream) | |
(format stream "#<CT2 ~a>" (make-circular))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this works, suggesting issue with how circular refs were worked out in first pass