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

Recursive print & depth abbreviation



First of all we need a recursive-p argument to the print functions,
including PRINT et al and FORMAT.  This is for precisely the same
reasons as the read functions -- in order to print an object I may
have to use print functions recursively.  It's not clear that there's a
good way to add recursive-p, especially since FORMAT already takes an
&rest argument.  (Excluding FORMAT for some religious reason would be
wrong.)

The second issue is that of print depth.  We never should have passed
the level to a structure print function.  Instead we should have said
that the print system worries about print depth in some automatic
fashion.  After all, the structure print function is going to utilize
the print system to print the structure, so the print system ought to be
able to do the depth abbreviation just fine.  An example of how to do
this is given by Dick Waters' PP facility, which implements all
abbreviation more or less automatically.

Another case in which a top-level versus recursive print must be
distinguished is when the printing system buffers output.  If you
interrupt it in the middle of a print and enter a break loop, clearly a
new set of buffers is required so that the original print can continue
undaunted later on.  The break loop needs to start a new top-level
print.  Hey, it's just like reading!

Passing a level or depth argument to the WRITE function is going to add
even more confusion (particularly given our silly definitions of
level vs. depth).  Anyway, why have we demoted PRINT, PRINC, PRIN1, and
FORMAT to second class functions?  Hell, everybody uses FORMAT in a
structure print function.
------