You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Identifier-delimited strings must have the closing delimiter on the first line. That looks awful in code. C# has """ strings that are either in-line or multi-line, and the multi-lines have the property that the indentation of the closing """ is subtracted from every line of the literal. D could do the same with its Identifier-delimited strings.
// current D codevoidf()
{
auto xs = q"EOSTODO - propose another string literalEOS";
}
// equivalent C# codevoidF(){varxs=""" TODO - propose another string literal """;// or, alternatively:varxs=""" TODO - propose another string literal """;}
// proposed D codevoidf()
{
auto xs = q"EOS TODO - propose another string literal EOS";
}
Technically, that is a breaking change, as EOS" may occur inside the literal (just not at the beginning of a line), but probably two things are true about current D code:
q"EOS strings are rare.
The few q"EOS strings that do exist don’t have EOS anywhere in the string content, let alone EOS".
The fix is trivial: Use another identifier.
The text was updated successfully, but these errors were encountered:
I think a single q"{ ... }" is enough for 99% of applications. My updated SDL specs added this kind of string under the name "scoped string", and the parser only checks for a single }" at the end, and does not do any scope counting.
Currently, Identifier-delimited strings must have the closing delimiter on the first line. That looks awful in code. C# has
"""
strings that are either in-line or multi-line, and the multi-lines have the property that the indentation of the closing"""
is subtracted from every line of the literal. D could do the same with its Identifier-delimited strings.Technically, that is a breaking change, as
EOS"
may occur inside the literal (just not at the beginning of a line), but probably two things are true about current D code:q"EOS
strings are rare.q"EOS
strings that do exist don’t haveEOS
anywhere in the string content, let aloneEOS"
.The fix is trivial: Use another identifier.
The text was updated successfully, but these errors were encountered: