Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2
Steven Schveighoffer
schveiguy at gmail.com
Fri Jan 29 15:23:52 UTC 2021
On 1/29/21 7:41 AM, Paul Backus wrote:
> 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.
This is not true. mixin(i"...") will work just fine (an implicit idup
will be added).
-Steve
More information about the Digitalmars-d
mailing list