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

Dukc ajieskola at gmail.com
Fri Jan 29 12:09:26 UTC 2021


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.

Let's face it, having to import a library function to use 
`printf` with interpolated strings is a small price to pay to 
avoid the first issue.


More information about the Digitalmars-d mailing list