[previous] [up] [next]     [index]
Next: Filesystem Utilities Up: Ports Previous: Customizing Read

Customizing Display, Write, and Print

Each output port has its own port display handler, port write handler, and port print handler. These handlers are invoked to output S-expressions to the port when the standard display, write or print procedure is applied to the port. A port display/write/print handler takes a two arguments: the value to be printed and the destination port. The handler's return value is ignored.

The default port display and write handlers print Scheme expressions with MzScheme's built-in printer (see section 14.4). The default print handler calls the global port print handler (the value of the global-port-print-handler parameter; see section 9.4.1.2); the default global port print handler is the same as the default write handler.



PLT