C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Supporting f-strings in C++: draft-R1

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sun, 15 Oct 2023 22:06:37 -0400
On Sun, Oct 15, 2023 at 7:55 PM Chris Gary via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Just some thoughts:
>
> I find it strange that the "{}" syntax was adopted instead of some variation on "%" or "introducer-then-parameters" instead of "scoped parameters".
>
> The former requires single-scope balancing, whereas the latter can be matched with a regular expression (depending on what is allowed), and is easier to validate.

This is rather out-of-bounds, but `{}` has been used by many
languages. C++ didn't invent it out of thin air; it was chosen in part
to be familiar to users of languages that had already adopted it.

Furthermore, the `{}` syntax was not intended to be used to evaluate
arbitrary C++ expressions. So it's reasonable to expect some
complexity when adopting a formatting syntax for a task it was never
intended to handle.

Received on 2023-10-16 02:06:59