DIP 1027---String Interpolation---Format Assessment
newshound2 at digitalmars.com
Tue Feb 25 06:54:34 UTC 2020
On 2/24/2020 2: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.
> This means you can have code that treats an interpolated string differently than
> a string. Overloads based on literal types are not a new feature.
Were you proposing that an i"xxxx" be a different type? (DIP 1027 did not assign
a type to it at all.) This would be radically different from DIP 1027, and a
large increase in complexity (adding any new basic types is a big deal and a
very intrusive change, and is tough to justify).
This is different enough from DIP 1027 that it would merit a separate DIP.
DIPs for the core language specify only behaviors, not implementations.
Implementation possibilities can be included in an advisory manner only. Note
that nowhere in the (massive and complicated) C++ core language specification is
there any description of how the compiler should be implemented. Writing that an
implementation must refer to specific templates implies that the behavior is
customizable by the user via modifying those templates.
More information about the Digitalmars-d-announce