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

Steven Schveighoffer schveiguy at gmail.com
Mon Feb 1 18:43:59 UTC 2021


On 2/1/21 1:15 PM, Paul Backus wrote:
> On Monday, 1 February 2021 at 17:52:35 UTC, Adam D. Ruppe wrote:
>> On Monday, 1 February 2021 at 17:06:36 UTC, Paul Backus wrote:
>>> No, you've added an extra level of quoting by mistake.
>>
>> oh yeah, that's right.
>>
>> So we could prolly just define the stringof of interp to be slightly 
>> less crazy (the source version either being the proper fqn or the 
>> literal itself) and then there's no special case in mixin.
> 
> Well, you can't define .stringof in user code--at least, not in a way 
> the compiler will recognize--so you'd have to make the interp literals 
> into a new builtin type rather than a library template.

I kind of don't want:

mixin(i"int ${foo} = ${bar};");

to do something different than

mixin(i"int ${foo} = ${bar};".idup);

Because that would be utterly confusing. If stringof isn't going to 
produce the same output, the idup should be inserted.

idup should be CTFE able at all times (the one exception is floats, but 
that is a separate issue that needs solving regardless).

-Steve


More information about the Digitalmars-d mailing list