DIP 1027---String Interpolation---Community Review Round 1

Martin Tschierschke mt at smartdolphin.de
Wed Dec 11 12:11:34 UTC 2019


On Wednesday, 11 December 2019 at 11:05:25 UTC, Sebastiaan Koppe 
wrote:
> On Wednesday, 11 December 2019 at 09:52:21 UTC, Mike Parker 
> wrote:
>> This is the feedback thread for the first round of Community 
>> Review for DIP 1027, "String Interpolation":
>>
>> https://github.com/dlang/DIPs/blob/148001a963f5d6e090bb6beef5caf9854372d0bc/DIPs/DIP1027.md
>
> Nice!
>
> I just have a few nitpicks:
>
> - I don't mind the required prefix 'i', but what about q{} 
> strings? I probably want to use interpolation there as well
>
> - I know it is bikeshedding but since string interpolation is 
> 99% syntax, I vote for "either a single $colon for variables or 
> ${expression} for expressions", like literally every other 
> modern language.
>
> Besides that, this is really nice.

Yes +1! It should be something common, not a dlang only syntax.
=> $var and ${expression}

https://en.wikipedia.org/wiki/String_interpolation

But this alone gives no way for formatting numbers, so maybe 
${%9.6f}{fvar} ?


More information about the Digitalmars-d mailing list