String Interpolation Compare - DIP1027 and YAIDIP
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Sat Oct 21 07:04:35 UTC 2023
On 21/10/2023 7:57 PM, Walter Bright wrote:
> I'd agree that parsing it is a last resort if the { } also fails. But
> having implemented formatted writes, I can attest that parsing it is not
> a big deal. It's scanning till you see the %, then substitute your own
> version. Of course, using { } means the compiler does it for you at
> compile time.
This also means that one formatter doesn't have to know about another
formatters format string syntax.
Like how formattedWrite doesn't need to know about GDateTime.
And yes, I have that working today with the ``{:}`` syntax in my
codebase. Its great.
This is why I do not agree with Adam about his argument against
supporting the format string specifier as part of the language. Having
it in the language means it is all nicely unified.
More information about the Digitalmars-d
mailing list