[OT] C# can do all the interpolated strings now

Rumbu rumbu at rumbu.ro
Fri Dec 10 10:27:28 UTC 2021


On Thursday, 9 December 2021 at 12:21:06 UTC, Kagamin wrote:
> On Wednesday, 8 December 2021 at 10:46:31 UTC, WebFreak001 
> wrote:
>> Usage example: 
>> https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/interpolated-string-handler
>>
>> What do you think of these extended interpolated string 
>> expressions? I think these would fit well into D, and could 
>> give some new motivation now that we have had our interpolated 
>> strings DIPs rejected once and withdrawn once.
>
> Not sure if this is much better than FormattableString 
> overloads: 
> https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated#implicit-conversions-and-how-to-specify-iformatprovider-implementation

The interpolated handler can skip some expressions in the 
interpolated string or can use more performant inner details like 
spans. FormattableString parses *all* arguments and format them.



More information about the Digitalmars-d mailing list