scheme Input Output in Scheme


Input and Output in scheme is usually handled trough ports. A port is a data structure which is used to interact with the world outside Scheme. A Port isn't limited to files but can be used to read/write to sockets. In some ways, the port object is some kind of universal object that can not only manipulate file and sockets but any kind of read/write operation with the OS. For example, one could implement a port that can write to a printer or even control a CNC machine from Scheme using a port.