Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2

Paul Backus snarwin at gmail.com
Fri Jan 29 17:16:11 UTC 2021


On Friday, 29 January 2021 at 17:01:36 UTC, Steven Schveighoffer 
wrote:
> On 1/29/21 10:49 AM, Paul Backus wrote:
>> Once the `interp` instance passes through the implicit 
>> .stringof in mixin(...), all of that semantic information is 
>> lost. Most of the time you will get lucky and it will work 
>> anyway, but you have no guarantee.
>
> mixin(i"int ${idname} = 5;"); will ALWAYS be rewritten to 
> mixin(idup(i"int ${idname} = 5;"));
>
> If that is not clear in the DIP, it will be in the next update.

This directly contradicts what is written in the DIP, which is 
that if the tuple expansion compiles successfully, it is used, 
and the idup expansion is not attempted. If this is not what you 
intended, then the DIP needs to be revised to reflect that.


More information about the Digitalmars-d mailing list