Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2
Paul Backus
snarwin at gmail.com
Fri Jan 29 12:41:35 UTC 2021
On Friday, 29 January 2021 at 12:09:26 UTC, Dukc wrote:
> On Friday, 29 January 2021 at 11:09:57 UTC, Walter Bright wrote:
>> Sure, but #DIP1027 did not require a GC or fiddling around. So
>> it's not like it's not possible.
>
> You need to remember that perhaps the most important use case
> for string interpolation are string mixins. With DIP1027, one
> would have to write `mixin(i"foreach(i;0..${iterations})
> foo()".format)` instead of `mixin(i"foreach(i;0..${iterations})
> foo()")` that works with this proposal. Added `.format` for
> every single interpolated string mixin.
You cannot actually pass an i"..." literal directly to `mixin`
with this proposal; you have to call `idup` (or some other
function) to convert it to a string first.
More information about the Digitalmars-d
mailing list