That’s fine. I have no strong preferences for syntax here. I just want the functionality.
The problem is: There are not much options…
I actually even proposed a very “ugly” syntax first, which uses the trick C# uses. You would have than a whole row of """"""""
in some cases. Ugly but functional.
The syntax needs to be short I think, it needs to make it clear that a String literal starts, and it needs to be unambiguous. The proposed string:
is not, also not in combination with interpolation (because that’s an infix call to a function taking a closure).
I actually think it would even work with a single "\n
but that would only make more chaos with :
.
No matter the concrete syntax, I think it needs to be a “only opening” symbol anyway. Because the whole point is to not need a closing symbol and just use indentation.
But inventing a third, distinct syntactic option to declare string blocks seems quite odd. Martin said the same actually.
Like said, the design space is anyway quite limited. You have basically two options:
Something that resembles “here document” (here-doc symbol followed by custom delimiter, which needs to be repeated at the end), or using indentation as delimiter (with unindent as closing symbol).
After agreeing on the variant the only thing that can be discussed is actually which symbol opens the text block. But if you don’t want to add new syntax only for this use case (which is bad) there are not much options either. It’s "
or """
.
And using the here document variant (which is more or less also what C# does) ignores having indentation based blocks in the language, which is inconsequential. Still the algo for indented blocks needs to be applied to these text blocks to get rid of stripMargin
… The ending symbol is than just redundant noise that has no technical reason for existence.