Introduction

This module contains definitions for user-level scheme input/output routines. The first versions of GESCHEME (in its golden Texas days) contained I/O routines written in Scheme and in C. For efficiency and job security purposes, the better of this code has been translated to assembly language.

Now that portability and stability have outweighted the clock-cycle counting habits we all had some time ago, it became justified to develop, at least for prototyping reasons, a purely Scheme-based I/O library. Only then, with full knowledge of the pros and cons of different approaches, could it be decided to translate minor parts of the code to another more efficient language.

|Read| has traditionally always been programmed in Scheme. It returns the next item available in the input, be it an atom or a list (maybe itself containing lists). It calls |Read-atom| that returns the next atom in the input if a valid atom has been entered; or a singleton list containing the special syntactic element entered in case of `|.|', `|'|', etc.

Output is basically made of two routines: |write| and |display|. |Write| is intended to human interaction and will thus produce the most compact and elegant representation of an item; a representation that carries meaning directed towards human intellect, with the minimum syntactic frosting. |Display|, on the contrary, is required to produce an ASCII representation of an item such that it can be re-read by |Read|.

Besides these high-class routines, the library includes |read-line| that reads a full line from the input, |peek-char| that returns the next character without removing it from the buffer (of |#F| if no caracter is available), |unread-char| that reinserts the character just read into the buffer, and so on. These procedures are not well-liked because they imply the programmer is not using the full features of an interpreted language with a powerful command-line shell.