Unfortunately, Erlang has, as far as I can tell, always had string pasting without mandatory white space, so It did not follow the Prolog syntax on this point.
This means that it also always hasn’t interpreted double quote characters in a string as a quote character, but instead as end and start of two strings that get pasted.
The argument that the scanner is eager (that I also have used myself) is not really applicable for strings, but more for tokens like an operator or an unquoted atom.
For a string or a quoted atom, instead, as soon as the end delimiter is found, the token is emitted, and scanning continues on the next character.
A triple-quoted string has got a flexible start delimiter in that it can be any number of "
characters (terminated by white space), and when the string content is scanned it is known exactly how many "
characters that constitutes the end delimiter. As soon as it is found, the token is emitted and scanning continues on the next character.
Thus, strings and triple-quoted strings, according to the above, as implemented on the ‘master’ branch for OTP-27.0, behave consistently.
Although I think that strings pasted without white space are not useful and hard to read, unfortunately, when I implemented a warning for that, it immediately blew up in our test suites. If we have done it (by accident or whatnot) then others have too.
The warning for """
starting a string that is now present in OTP-26.1 is essential because that will change meaning in OTP-27.0 when triple-quoted strings are introduced. I have not heard of any problems due this, so apparently pasting an empty string to another string without intervening white space is not a common pattern.
If """
ends a string today, that will have the same meaning in OTP-27.0, therefore a warning for this is not essential.
Although I would love to make string pasting without white space an error (warning in OTP-26.2, error in 27.0), it seems to be too backwards incompatible even for own test suites’ code.
Pasting the empty string to another string seems to be a more uncommon pattern, but if we have to allow ""
to end+start+paste two strings, it would be weird to not allow that for the special case empty string as in """
ending a string.
All in all, to me it seems that the best we can do is to keep the currently suggested behaviour for triple-quoted strings (and regular strings) currently on ‘master’ to be released in OTP-27.0, which is to end the string at the end delimiter and continue scanning on the next character. This allows pasting any string (also the empty string) to the end of a string, without white space.