> Won't raise an exception for EOF.

Nor should it, EOF is only raised if the proc interface was so poor it couldn't 
signal it in any other way. Eventually we will get `io.nim` that uses a proper 
sum type for this.

> I guess 3. could be a function like your checkErr() but then it should always 
> raise something because you call it when you already know something special 
> happened, you just don't know yet which special thing.

Ok, that's helpful, thanks.

> NB: I don't know what target Nim aims at (C89? C99? POSIX? the same ones with 
> extensions? some specific platform?), but EOF is not defined as -1 in C99 
> standard, just as a negative value. So it should be a platform-dependent 
> #define (well, the equivalent for Nim), not a hardcoded value; or if the 
> normal return value is always positive, you can check for negative values.

We target the supported C compilers (Visual, clang, gcc), not the C "standard", 
so I don't care much about "-1 in theory could be something else".

Reply via email to