[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: PRINT-CIRCLE-STRUCTURE (Version 1)
- To: Jon L White <firstname.lastname@example.org>
- Subject: Issue: PRINT-CIRCLE-STRUCTURE (Version 1)
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Fri, 7 Oct 88 22:00 EDT
- Cc: email@example.com, Christopher.McConnell@A.GP.CS.CMU.EDU
- In-reply-to: <8810080135.AA02628@bhopal>
Date: Fri, 7 Oct 88 18:35:06 PDT
From: Jon L White <firstname.lastname@example.org>
re: Date: 5 Oct 88 20:47 PDT
Circularities need only be detected for
objects that would normally be printed by the default structure
I cannot accept any proposal with this kludgey restriction in it. If
circularities are going to be detected at all, they should be done
right. It's not difficult to call the user-defined print-function once
with a special stream argument that detects what the function prints
(i.e. what calls to WRITE and equivalent functions and FORMAT directives
it makes using that stream), and use that for circularity detection.
That's how the Symbolics Genera implementation works.
A "first cut" implementation is merely to descend all components of objects
when looking for circularities. At worst this will cause spurious #n='s
to appear in the output (which CLtL doesn't seem to proscribe), and may
impose some extra traffic on the "looker" (probably a hash-table).
What's a "component"?
Suppose I'm using defstruct instead of CLOS, and I want to add a slot
compatibly. Since I'm not using CLOS, I have to store that slot in a
table on-the-side. How does the component finder find it? The answer is
that it can't, which is why I maintain that the only viable approach is
to based circularity detection on what the user-defined print function
actually prints, not on any guesses as to what it might print.