DIP 1027---String Interpolation---Format Assessment

Steven Schveighoffer schveiguy at gmail.com
Tue Feb 25 00:07:17 UTC 2020


On 2/24/20 5:45 PM, Steven Schveighoffer wrote:
>> My inference of the discussion about this in the n.g. was the 
>> templates would be used so users could customize the behavior to be 
>> whatever they wanted.
>>
> 
> By accepting a different type from string. In other words, an overload.

I have a feeling from this comment that you are expecting that the 
compiler just literally lowers into the provided generated code, and 
leaves it up to the user to define the template. This is not the case.

The template will be defined in object.d, and the compiler will NOT 
COMPILE code that cannot find that template in the module object.d.

I would actually recommend that it lowers to:

.object._d_interpolated_string!(...), apples, bananas

To ensure that it cannot be intercepted.

-Steve




More information about the Digitalmars-d-announce mailing list