Opened 6 years ago

Closed 5 years ago

#337 closed defect (fixed)

Add make-eof-object procedure

Reported by: cowan Owned by: cowan
Priority: major Milestone:
Component: WG1 - Core Keywords:


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)

Change History (4)

comment:1 Changed 6 years ago by aag

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

comment:2 Changed 5 years ago by cowan

  • Status changed from new to decided

The WG voted to adopt this proposal using the name eof-object.

comment:3 Changed 5 years ago by cowan

  • Owner changed from alexshinn to cowan
  • Status changed from decided to writing

comment:4 Changed 5 years ago by cowan

  • Resolution set to fixed
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.