[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue: PRINT-CIRCLE-STRUCTURE (Version 1)



    Date: Fri, 7 Oct 88 18:35:06 PDT
    From: Jon L White <jonl@lucid.com>

    re:     Date: 5 Oct 88 20:47 PDT
	    From: masinter.pa@Xerox.COM

	    Circularities need only be detected for
	    objects that would normally be printed by the default structure
	    print-function.

	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.