DIP 1027---String Interpolation---Community Review Round 1
Jab
jab_293 at gmall.com
Sun Dec 15 20:07:23 UTC 2019
On Sunday, 15 December 2019 at 17:38:29 UTC, Adam D. Ruppe wrote:
> On Sunday, 15 December 2019 at 17:26:57 UTC, Jab wrote:
>> It being usable with snprintf() means it outputs something
>> that pretty much no other function uses.
>
> D's writef uses it too, as well as std.format. Do do the vibe
> logging functions.
>
> It is a common format.
>
> (though D's writef is supposed to replace C's printf... for
> great part because of type safety.))
Literally the next sentence:
> The only thing I know of that implements printf-style
> formatting is printf (or uses sprintf to implement it).
This is going to add a feature to the language that is dependent
on a library feature. Even though the compiler creates and
verifies the format strings, it's going to have to re-parse the
format string at runtime anyways.
Implementing string interpolation will just grow the dependency
on printf/sprintf. Cause like I said, no other function really
actually implements that formatting scheme themselves. This
limits and over-complicates the code around it.
More information about the Digitalmars-d
mailing list