On 13 January 2012 04:14, Aleix Conchillo Flaqué <aconchi...@gmail.com> wrote: > Whenever eof is reach in a port, a call to unread-char passing eof > triggers an error. I'm not sure what's the right behavior for this, > but I guess the way it is now is just as the user should be > responsible to check eof.
The user should indeed be checking for this because eof is not a character, rather, a special value used to indicate that no more data is available on the port. This value is not read from the port, it does not make sense to unread it. > > A note in the documentation would help in any case. Suggestions welcome. Personally I find the documentation sufficiently clear on the usage of unread-char only accepting a character value and equally clear that an eof value is not a character.