Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2

Imperatorn johan_forsberg_86 at hotmail.com
Thu Feb 4 14:21:07 UTC 2021


On Thursday, 4 February 2021 at 13:49:30 UTC, Adam D. Ruppe wrote:
> On Thursday, 4 February 2021 at 13:37:32 UTC, Imperatorn wrote:
>> In the example you provided, it depends on what character is 
>> used. If { and } are used (instead of $), you need to escape 
>> those by { and }.
>
> Don't you see how that would make the string uglier and harder 
> to use correctly by forcing escaping of an extremely common 
> sequence? Remember, this is used with D code, along side curly 
> brace syntax and the $ operator in slices, as well as for 
> ordinary strings that use $ to mean a bunch of other things.
>
> ${} is unambiguous in token strings and much more clear in 
> normal strings.

Yup. Agreed, just thought I'd share how it works in C# for 
reference.


More information about the Digitalmars-d mailing list