Digest #53 2019-05-21

Contributions

[79] 2019-05-20 20:19:43 ruv wrote:

requestClarification - Receiving a zero-length string

Why 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.

Replies

[r209] 2019-05-20 07:37:31 AntonErtl replies:

comment - Behavior when no text found

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.


[r210] 2019-05-20 14:53:40 BerndPaysan replies:

comment - Behavior when no text found

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.


[r211] 2019-05-20 16:54:34 AntonErtl replies:

comment - Behavior when no text found

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.