hgm wrote:So that was just a private guess?
But guessing is unfortunately not what this thread is about. There request wast for an opinion-free interpretation, staying away from the 'deadly broken "because I don't see what else could be" way of reasoning'...
Of course it is very easy to dream up things like "it would work great if \n was defined to be a command terminator", or "it would work great if bestmove 0000 would mean resign", and a dozen others. But there are some that do not want to hear such fanciful interpretations, and want to go "by the book" of what is exactly written.
Well, unfortunately it is NOT written that \n is a command terminator, and how to handle the case when it is received at a time where a syntactically incorrect or incomplete command is received. Because even with command terminator that would be ambiguous: incorrect commands could be completely ignored, or they could be partially executed. So assuming \n is a command terminator only increases the ambiguity for how bestmove immediately followed by \n should be handled. While assuming it is just a token like any other does in fact unambiguously solve every conceivable situation through the rule that invalid tokens should be ignored (albeit in an often idiotic way).
I was responding to what you quoted:
hgm wrote:Code: Select all
* all command strings the engine receives will end with '\n',
also all commands the GUI receives should end with '\n'
I don't know why you included the asterisk there. Presumably, you are clipping a part of comment and this is ignorable. Now let's focus on
all command strings the engine receives will end with '\n'
Key words to note: "all", "command" and "end"
Now note the word "command" in that line. This line is about commands and is indicating that /n
ends—meaning
terminates—
all commands. Hence, /n is a
command terminator as opposed to a
command separator.
If the role of /n were intended as a
separator the word "all" would not be present or the word "except" would appear preceding some type of qualification. Since "all" is present without qualification, the role of /n is as a
terminator. If the role of /n were as a
separator, it would not be required for the last command. The use of the word "all" in the above line precludes this interpretation.
The above is how I parsed what you quoted. I assumed you did not omit anything relevant in the context from which it came from.