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

Dukc ajieskola at gmail.com
Fri Jan 29 14:17:41 UTC 2021


On Friday, 29 January 2021 at 13:21:18 UTC, Paul Backus wrote:
> In concrete terms, what happens is that mixin implicitly calls 
> `.stringof` on each of its arguments. So your mixin example 
> would be lowered to
>
>     mixin(interp!"foreach(i;0.."().stringof, 
> iterations.stringof, interp!") foo();"().stringof);
>
> And evaluating the `.stringof` calls would result in
>
>     // assuming iterations == 5
>     mixin(`interp()`, `5`, `interp()`);

Oops. I quess the DIP would do well to solve that somehow.

>
> ...which in this specific case happens to be a compile error, 
> so it actually *would* be rewritten by the compiler to use 
> `idup`..

Or perhaps not, since the compiler error would not result from 
arguments not being accepted.





More information about the Digitalmars-d mailing list