Just another example of missing string interpolation

Imperatorn johan_forsberg_86 at hotmail.com
Fri Oct 20 09:43:47 UTC 2023


On Friday, 20 October 2023 at 08:26:35 UTC, Max Samukha wrote:
> 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).

I didn't know about that old "'static' function parameters", what 
was that?


More information about the Digitalmars-d mailing list