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

Adam D. Ruppe destructionator at gmail.com
Sun Feb 2 14:11:41 UTC 2020


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.


More information about the Digitalmars-d mailing list