eof-object - return the end-of-file object
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
(import (rnrs io simple)) ;R6RS
(import (scheme base)) ;R7RS
Returns an end-of-file object.
Returns a single value which is an end-of-file object.
(eqv? (eof-object) (eof-object))
=> #t ;R6RS
(eq? (eof-object) (eof-object))
=> #t ;R6RS
The end-of-file object is used generally to indicate an end-of-file
condition. It appears in I/O routines, it is often passed through in
parsers, and it is used in generators (e.g. SRFI 158).
Works the same anywhere that it's available. Programs written for
earlier reports would sometimes get access to the end-of-file object
by using tricks like reading from an empty file or string port.
R6RS has a single unique end-of-file object.
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
The wrong number of arguments was passed.
The assertions described above are errors.
Implementations may signal an error, extend the procedure's
domain of definition to include such arguments,
or fail catastrophically.
First appeared in R6RS and R7RS. Previous reports had
but the end-of-file object was not necessarily disjoint from other
Other languages take different approaches, such as having the read
function return an empty result, or having it return an error and
providing a function to test for the end-of-file condition.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Markup created by unroff 1.0sc, March 04, 2023.