Prev Up Next

Scheme's reader procedures take an optional input port argument. If the port is not specified, the current input port (usually the console) is assumed.

Reading can be character-, line- or s-expression-based. Each time a read is performed, the port's state changes so that the next read will read material following what was already read. If the port has no more material to be read, the reader procedure returns a specific datum called the end-of-file or eof object. This datum is the only value that satisfies the eof-object? predicate.

The procedure read-char reads the next character from the port. read-line reads the next line, returning it as a string (the final newline is not included). The procedure read reads the next s-expression.

Prev Up Next

Log in or registerto write something here or to contact authors.