Copyright (C) 2000-2012 |
GNU Info (guile.info)PortsPorts ===== [Concept of the port abstraction.] Sequential input/output in Scheme is represented by operations on a "port". Characters can be 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. - primitive: input-port? x Returns `#t' if X is an input port, otherwise returns `#f'. Any object satisfying this predicate also satisfies `port?'. - primitive: output-port? x Returns `#t' if X is an output port, otherwise returns `#f'. Any object satisfying this predicate also satisfies `port?'. - primitive: port? x Returns a boolean indicating whether X is a port. Equivalent to `(or (input-port? X) (output-port? X))'. automatically generated by info2www version 1.2.2.9 |