DIP 1027---String Interpolation---Community Review Round 1
Patrick.Schluter at bbox.fr
Mon Dec 16 11:18:33 UTC 2019
On Monday, 16 December 2019 at 11:08:00 UTC, Patrick Schluter
> On Monday, 16 December 2019 at 10:48:51 UTC, aliak wrote:
>> Resolving interpolation at compile time is imho incompatible
> with handling them as regular strings.
Maybe I'm wrong here, I haven't thought it through, but in first
approach I think that's an essential point. As the string
contains code, if evaluated at CT, the string must be split
somehow in literal parts and code parts. Allowing the i-string to
be handled as regular string implies that the splitting happens
sometime between when it is declared and after it is used, which
can happen after runtime.
int b = 20;
string inter = i"$(a+b)";
void fn(string s)
How would that work?
> The question is then do we want CT or RT interpolated strings.
> RT interpolated strings can still be provided by a library.
More information about the Digitalmars-d