Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2
jmh530
john.michael.hall at gmail.com
Fri Jan 29 15:26:58 UTC 2021
On Friday, 29 January 2021 at 15:06:20 UTC, Steven Schveighoffer
wrote:
> [snip]
>
> With a metaprogramming wrapper, it would be:
>
> printf(i"${item} %02d${other_item}");
>
> Without a metaprogramming wrapper, you call it like this:
>
> printf("%s %02d", item, other_item); // yes, just use printf
> the way it was intended
>
> The point of this is, we don't want to fit into printf-style
> formatting, because it's too niche a need, and extremely
> limiting. Use the wrapper if you want printf formatting. This
> is not a burden on anyone (the wrapper took me 15 minutes to
> write, and is an inlineable no-processing call).
> [snip]
Is there any reason why it needs to be an overload of printf
instead of a separate function, like say iprintf?
More information about the Digitalmars-d
mailing list