Next: , Previous: Port Types, Up: Port Primitives

14.9.2 Constructors and Accessors for Ports

The procedures in this section provide means for constructing ports, accessing the type of a port, and manipulating the state of a port.

— procedure: make-port port-type state

Returns a new port with type port-type and the given state. The port will be an input, output, or I/O port according to port-type.

— procedure: port/type port

Returns the port type of port.

— procedure: port/state port

Returns the state component of port.

— procedure: set-port/state! port object

Changes the state component of port to be object. Returns an unspecified value.

— procedure: port/operation port symbol

Equivalent to

          (port-type/operation (port/type port) symbol)
— procedure: port/operation-names port

Equivalent to

          (port-type/operation-names (port/type port))
— procedure: make-eof-object input-port

Returns an object that satisfies the predicate eof-object?. This is sometimes useful when building input ports.