[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Incompatible change to READ, TYI et. al.



As of System 59.19, the functions READ, TYI, TYIPEEK, READCH, and
READLINE interpret their eof-option argument slightly differently.
If an end-of-file condition is encountered inside one of these
functions, then the action taken will be as follows:

  If any object was provided as the eof-option argument, that object
    will be returned by the function.
  If no object was provided as the eof-option argument, an error is
    signalled.

This behavior is not quite compatible with Maclisp, but it is a lot more
consistent than the Maclisp definition and than the previous behavior.
You may have problems if you have a program that reads from streams,
with one of the above functions, without passing any explicit eof-option
argument, expecting -1 or something like that to be returned.  The way
to fix any problems caused by this change is to provide an eof-option
argument explicitly.

This means that it is now possible to provide NIL as an eof-option
argument and have it work (that is, NIL will be returned if end-of-file
is reached).