DIP 1027--String Interpolation--Final Review Discussion Thread

Timon Gehr timon.gehr at gmx.ch
Sun Feb 2 14:20:16 UTC 2020


On 02.02.20 15:11, Adam D. Ruppe wrote:
> On Sunday, 2 February 2020 at 07:23:31 UTC, Walter Bright wrote:
>>> 2) If (1) isn't an option, wouldn't printf(i"interpolated ...".c) work?
>>
>> structs and tuples aren't interchangeable if you have to remember to 
>> do things like that.
> 
> You don't really have to remember per se because you'll get a type 
> mismatch error if you don't do it. The compiler error message could even 
> recognize it and remind you in the error message to use the method.
> 
> Will you sacrifice all the other use cases in their entirety just 
> because `printf(i"".c)` is not 100% identical to `printf(i"")`? I don't 
> see the logic in that. D is an all purpose language, not syntax sugar 
> over C.

This is a use case for `alias this`, the language just has to support it.


More information about the Digitalmars-d mailing list