Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2
Dukc
ajieskola at gmail.com
Fri Jan 29 13:03:45 UTC 2021
On Friday, 29 January 2021 at 12:41:35 UTC, Paul Backus wrote:
> 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.
Why? I understood it like this:
`mixin(i"foreach(i;0..${iterations}) foo();")` is first attempted
as `mixin(Interp!"foreach(i;0.."(), iterations, Interp!")
foo()"());`. Since `mixin` accepts only strings, `idup` is
implicitly called on the arguments.
What went wrong?
More information about the Digitalmars-d
mailing list