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

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Dec 9 15:55:42 UTC 2021

On Thursday, 9 December 2021 at 15:47:11 UTC, Steven 
Schveighoffer wrote:
> On 12/9/21 10:20 AM, WebFreak001 wrote:
>> I don't think the common case should always have this extra 
>> `i` prefix + needed function calling parentheses or ufcs dot. 
>> Just only writing `text"hello $name"` is shorter, easier to 
>> type, better to read.
> Note that the string interpolation proposal does not preclude 
> this possibility happening later.

You can fix this with implicit conversion to string, but it makes 
for weaker typing:

1. expand to list

2. if expanding to list fails type check then try to concatenate 
to string

3. if string does not pass type check, report error

So, it is easy to fix without any extra ```.text``` annoyances.

More information about the Digitalmars-d mailing list