Digest #51 2019-05-13
- Should ACCEPT echo the line terminator if it is a CR or LF, or just leave the cursor where it was before the terminator?
- Should the terminator be placed into the receive buffer, or just the text received up to the terminator?
- What is the behavior of ACCEPT when the maximum number is reached with no terminator?
I realize that probably these are all implementation-specific, but are there any conventional norms, especially about #2 and #3?
Why didn't you use an FLOCAL ?
Why not use FLOCALs ?
Probably, because there is no FLOCAL in the standard, either.
The standard document is clear here: What happens to the display upon receiving the line terminator is implementation-defined, but the recommendation (in the rationale) is to leave the cursor at the end of the entered text without echoing the line terminator. Note that if your ACCEPT supports editing with cursor-left and such, you should move the cursor to the end rather than leaving it where it is.
That's also clear in the document: When a line terminator is received, nothing is appended to the string. I.e., the terminator should not be placed into the string.
The document specifies termination only on receiving the line terminator, and does not specify any particular behaviour when reaching n1 characters. Gforth places the cursor behind the n1th character, but when you enter a character then, it just beeps.