SRFI 181: Custom ports

by John Cowan

status: draft (2020-02-15)

See also SRFI 79: Primitive I/O, SRFI 81: Port I/O, SRFI 82: Stream Ports, and SRFI 91: Extended ports.


This is an extract from the R6RS that documents its support for custom ports. These provide a hook into the Scheme port system from below, allowing the creation of binary and textual ports that behave exactly like file, string, and bytevector ports, but whose basic operations are provided by user code. It has been lightly edited to fit R7RS style.