SRFI 181: Custom ports (including transcoded ports)

by John Cowan

Based on R6RS.

status: final (2020-09-08)

keywords: I/O

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


This SRFI is derived from parts of library section 8.2.4, library section 8.2.7, library section 8.2.10, and library section 8.2.13 of the R6RS. These sections are themselves based on parts of SRFI 79, SRFI 80 and SRFI 81. These procedures provide a hook into the Scheme port system from below, allowing the creation of custom ports that behave as much as possible like the standard file, string, and bytevector ports, but that call a procedure to produce data to input ports or to consume data from output ports. Procedures for creating ports that transcode between bytes and characters are an important special case and are also documented in this SRFI.