michiguel wrote:It implies that end of line (EOL or \n in C) finishes MESSAGE and it does not say that "\\n" should be interpreted to break a line, so I cannot assume that your suggestion should work. On top of that, it does not work.
For clarity: the description deals with what you send, not what you have in the source code of your engine if it happens to be written in C. If your engine source contains "\\n", you send '\' + 'n'. If it contains "\n", you send a LINEFEED.
That being said, the specs imply that the message ends when you send LINEFEED. It does not say anything about how sending a backslash followed by an 'n' should be treated. I, for one, would have expected almost universal conventions for embedding control characters in text would work.
If this was meant to be multi line, then Tim did everything possible to obfuscate the protocol and hide its original purpose making WB to behave exactly in the opposite direction.
This is not without precedent. What do you think about xboard sending
new\nrandom\n (on a single line!) to an engine, when the user specified
-firstInitString "new\nrandom\n"? But I brought up the point on the GNU bug-xboard mailing list, so we will get to see Tim's reaction.
I am digressing, but I would really wish to read the WB protocol without playing guessing games all the time. We should read this and implement it, without trying to guess where the loopholes are. Things should be spelled out. This document should be written for engineers, not lawyers

Besides, the whole thing needs to be rewritten from scratch, with short examples and dumping all the backward compatibility issues to an appendix. I do not mean that you should do this task, but someone should. Maybe some sort of a team effort.
I fully agree. The specs as they are are too ambiguous. To the point where engine authors really are in doubt whether they should count moves that are forced to them as part of the current TC session. (This breaks many engines for running on classical TC with an external book.)
So the specs should be made more explicit. But for the
telluser and
tellusererror commands I think it would be sensible to specify that standard escape sequences work, rather than that they should not work. I don't see any harm in that, and lot of advantages. I don't think there would be _any_ existing engine that relies on '\' + 'n' sent in a telluser MESSAGE currently being printed as a backslash and an 'n'. Why would anyone want to print that?
And if we want to intentionally allow multiple interpretations, like in the case of clearing hash tables on a
new command or not, we should explicitly mention that in the specs.