5.10 Object Printing
To customize the way that a class instance is printed by write or display, implement the printable<%> interface.
The printable<%> interface includes only the
custom-write and custom-print methods. Each accepts
a single argument, which is the destination port to write or
display the object.
Calls to the custom-write or custom-display are like calls to a procedure attached to a structure type through the prop:custom-write property. In particular, recursive printing can trigger an escape from the call.
See prop:custom-write for more information. The printable<%> interface is implemented with interface* and prop:custom-write.