eof-object? - test if an object is the end-of-file object
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
(import (rnrs io simple)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
is an end-of-file object, otherwise returns
The end-of-file object is returned by various I/O procedures
when they reach end of file.
Returns a single boolean object.
This procedure is used on the result of I/O read operations, such as
to see if the port has an end-of-file condition. It also appears in
the context of generators (e.g. SRFI 158).
There is a slight difference between R6RS and the other reports.
- R4RS, IEEE Scheme, R5RS, R7RS
The precise set of end-of-file objects will vary among
implementations, but in any case no end-of-file object will
ever be an object that can be read in using
No object which satisfies this predicate satisfies any of
or any record type predicate.
There is a unique end-of-file object. (This also satisfies the R7RS
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.
This procedure was unchanged in Scheme from R2RS (AI Memo No.~848,
1985) until R6RS, which is when the end-of-file object become a unique
object for the first item. R7RS branched off from R5RS and did not
adopt the R6RS semantics for this object.
LISP 1.5 had an end-of-file character that printed as
and an end-of-record character that printed as
PDP-10 MacLISP had an optional other argument to
that let the program specify its own end-of-file object. Scheme before
R2RS would have used this implementation of
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.