Go to the first, previous, next, last section, table of contents.


Ports

Input and output devices in Scheme are represented by ports. All input and output in Scheme programs is accomplished by operating on a port: characters are read from an input port and written to an output port. This chapter explains the operations that Guile provides for working with ports.

The formal definition of a port is very generic: an input port is simply "an object which can deliver characters on command," and an output port is "an object which can accept characters." Because this definition is so loose, it is easy to write functions that simulate ports in software. Soft ports and string ports are two interesting and powerful examples of this technique.


Go to the first, previous, next, last section, table of contents.