Just another example of missing string interpolation

Max Samukha maxsamukha at gmail.com
Fri Oct 20 08:26:35 UTC 2023


On Friday, 20 October 2023 at 07:14:45 UTC, Walter Bright wrote:

>
> ```
> tuple("format %s %s sss", abc, 73)
> ```

This requires cumbersome workarounds for the format string to be 
accessible at compile time:

alias tmp = i"format %s %s sss";
string html = makeHtmlFromTemplate!(tmp[0])(tmp[1..$]);

The simple tuple approach could work in Zig - they have 
"comptime" for partial evaluation (D's old 'static' function 
parameters plan put into practice).




More information about the Digitalmars-d mailing list