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

Re: pretty printing



    From:    Stanley Letovsky <Letovsky>
    Subject: pretty printing
    To:      T-Bugs
    
    I notice that the pretty-printer is 1 or 2 orders of magnitude slower
    than print: is this inevitable, or is the current pretty printer
    inefficient in some way? If so, will that be corrected in 2.7? If
    not, could you give me a pointer to the source code?

The T pretty-printer is nearly the most simple-minded, inefficient
pretty-printer imaginable, and intentionally so.  It would not need
to be this way if someone were to trouble to write an efficient version,
but that is quite difficult.  None of the implementors are interested
in pretty-printing since they have no use for it and there hasn't
been much demand.  Also, we feel that pretty-printing is more the
province of a text editor than a language implementation, and we aren't
in that business at this time.

To locate source code, use PP or WHERE-DEFINED.  In T 2.7, WHERE-DEFINED
works on operations which have default methods, so you can say

    (WHERE-DEFINED PRETTY-PRINT)
    
to find out.  At Yale, the T 2.7 sources are all in the directory
[ring] //fs1/t/t2.7/sys.