Digest #53 2019-05-21
n2 is specified as non-zero, positive integer?
What if the first received char is a line terminator? It seems that zero should be returned in such case.
I don't see this defined in the standard at all (not even as ambiguous condition). I guess we should fix this in the standard.
I think a system should react to this condition by reporting an error.
There's not even a suitable standard throw code available.
Gforth's current behavior is to return whatever character is found after the end of the input buffer, which is a classical read outside boundary problem.
I have just fixed this in Gforth, which now produces an error. I have used -16 "Attempt to use zero-length string as a name" as throw code, but it does not quite fit.