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

Re: printing of procedures



      When a procedure is printed, T outputs something like
    "#{Procedure 200 FORMAT}".  If I want procedures to print 
    differently (say, "#{FORMAT}" or "pFORMAT"), what do I
    have to change and how do I do it?
    -------

If you want the procedures that you define to print differently, just
add a print-method:

Old: (define (foo x y) (+ x y))

New: (define foo
       (object (lambda (x y) (+ x y))
         ((print self stream) (format stream "#{This is foo}"))))

There is no released way of changing the default print-method for
all procedures.  If you want to hack the implementation, the routine
to look at is PRINT-RANDOM in PRINT.T.