eof-object - return the end-of-file object

LIBRARY

(import (rnrs))                     ;R6RS
(import (rnrs io ports))            ;R6RS
(import (rnrs io simple))           ;R6RS
(import (scheme base))              ;R7RS

SYNOPSIS

(eof-object)

DESCRIPTION

Returns an end-of-file object.

RETURN VALUES

Returns a single value which is an end-of-file object.

EXAMPLES

(eof-object? (eof-object))
          => #t

(eqv? (eof-object) (eof-object))
          => #t    ;R6RS

(eq? (eof-object) (eof-object))
          => #t    ;R6RS

APPLICATION USAGE

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).

COMPATIBILITY

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.

ERRORS

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed.
R7RS
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.

SEE ALSO

eof-object?(3scm)

STANDARDS

R6RS, R7RS

HISTORY

First appeared in R6RS and R7RS. Previous reports had eof-object?, but the end-of-file object was not necessarily disjoint from other types.

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.

AUTHORS

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/.


Markup created by unroff 1.0sc,    March 04, 2023.