Ticket #337 (writing defect)
Add make-eof-object procedure
| Reported by: | cowan | Owned by: | cowan |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | WG1 - Core | Keywords: | |
| Cc: |
Description
make-eof-object returns an object which answers #t to eof-object?.
From Vincent Manis:
This isn't just an attempt to create a vain orthogonality; there are good reasons why arbitrary code might wish to return an eof object. For example, a DBMS interface might have a routine that returns one row, as a list or a vector, at a time; after the last, it is perfectly reasonable to return an eof object.
An argument against providing this is that the constructor may be trivially written, as shown [below]. A similar argument could be applied to zero?, newline, quotient, remainder, and modulo, among others. R7RS is not afraid to provide easy-to-implement procedures in the name of simplicity, orthogonality, or historical compatibility. I think the lack of an eof constructor is worth remedying.
(let* ((p (open-input-string ""))
(x (read p)))
(close-port p)
x)

<xacc.ide@…> points out that R6RS calls this procedure eof-object, not make-eof-object, and suggests that we use that name.