Next: Customizing DisplayWrite, and Up: Ports Previous: Reading and Printing

## Customizing Read

Each input port has its own port read handler. This handler is invoked to read S-expressions from the port when the standard `read` procedure is applied to the port. A port read handler takes a single argument: the port being read. The return value is the value that was read from the port.

- `(port-read-handler input-port)` returns the current port read handler for input-port.
- `(port-read-handler input-port proc)` sets the handler for input-port to proc.

The default port read handler reads standard Scheme expressions with MzScheme's built-in parser (see section 14.3).