Common Lisp the Language, 2nd Edition

Next: Printed Representation of Up: Common Lisp the Language Previous: Operations on Streams

# 22. Input/Output

Common Lisp provides a rich set of facilities for performing input/output. All input/output operations are performed on streams of various kinds. This chapter is devoted to stream data transfer operations. Streams are discussed in chapter 21, and ways of manipulating files through streams are discussed in chapter 23.

While there is provision for reading and writing binary data, most of the I/O operations in Common Lisp read or write characters. There are simple primitives for reading and writing single characters or lines of data. The `format` function can perform complex formatting of output data, directed by a control string in manner similar to a Fortran `FORMAT` statement or a PL/I `PUT EDIT` statement. The most useful I/O operations, however, read and write printed representations of arbitrary Lisp objects.

- Printed Representation of Lisp Objects
  - What the Read Function Accepts
  - Parsing of Numbers and Symbols
  - Macro Characters
  - Standard Dispatching Macro Character Syntax
  - The Readtable
  - What the Print Function Produces
- Input Functions
  - Input from Character Streams
  - Input from Binary Streams
- Output Functions
  - Output to Character Streams
  - Output to Binary Streams
  - Formatted Output to Character Streams
- Querying the User