Digest #51 2019-05-13
Contributions
requestClarification - Behavior at end of line and end of data
Three questions:
- 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?
Thanks!
Replies
proposal - F>R and FR> to support dynamically-scoped floating point variables
Why didn't you use an FLOCAL ?
proposal - F>R and FR> to support dynamically-scoped floating point variables
Why not use FLOCALs ?
proposal - F>R and FR> to support dynamically-scoped floating point variables
Probably, because there is no FLOCAL in the standard, either.
requestClarification - Behavior at end of line and end of data
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.