Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2
Steven Schveighoffer
schveiguy at gmail.com
Fri Jan 29 17:21:15 UTC 2021
On 1/29/21 12:16 PM, Paul Backus wrote:
> 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.
Yes, I was not aware of the mixin parameter list acceptance. The
intention was for it to convert to a string in that case. It will be
fixed in an update as mentioned.
The intention is for the expanded version only to be used in template or
function arguments.
-Steve
More information about the Digitalmars-d
mailing list