Date: Wed, 18 Dec 2024 17:09:35 -0500
N3355's syntax is worse because it uses the labels. Unlike other languages
where labels are somewhat normal and perhaps nicely scoped, labels in C and
C++ defy scope (they exist inside of the function as a whole). That makes
it hard to compose and reuse labels; N3377 discusses this and other reasons.
During the discussion in October, WG14 also had hangups around what was
accepted; the consensus was not unanimous. N3377 will patch up those
concerns -- including my own -- very nicely.
I look forward to seeing N3377 soon in WG14, and hopefully adding it to C2y.
Sincerely,
JeanHeyd
On Wed, Dec 18, 2024 at 4:10 PM Jens Maurer via Std-Proposals <
std-proposals_at_[hidden]> wrote:
>
>
> On 18/12/2024 11.49, Jan Schultke via Std-Proposals wrote:
> > I want to have break/continue statements with labels in C++. Now is the
> time.
> >
> > https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm has been
> > accepted into C2y, with the syntax:
> >
> > label: for (/* ... */) {
> > while (true) { break label; }
> > }
> >
> > https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf proposes to
> > update this syntax to
> >
> > for label (/* ... */) {
> > while (true) { break label; }
> > }
> >
> > While N3377 may be a bit more syntactically sound (not reusing labels
> > that are otherwise only goto targets, I'm not a fan of that idea.
>
> I think the strictly worst option would be if WG14 picked
> the N3377 syntax, but WG21 picked the N3355 syntax.
> So, WG21 needs to know WG14's opinion on N3377 before
> committing to anything.
>
> Jens
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
where labels are somewhat normal and perhaps nicely scoped, labels in C and
C++ defy scope (they exist inside of the function as a whole). That makes
it hard to compose and reuse labels; N3377 discusses this and other reasons.
During the discussion in October, WG14 also had hangups around what was
accepted; the consensus was not unanimous. N3377 will patch up those
concerns -- including my own -- very nicely.
I look forward to seeing N3377 soon in WG14, and hopefully adding it to C2y.
Sincerely,
JeanHeyd
On Wed, Dec 18, 2024 at 4:10 PM Jens Maurer via Std-Proposals <
std-proposals_at_[hidden]> wrote:
>
>
> On 18/12/2024 11.49, Jan Schultke via Std-Proposals wrote:
> > I want to have break/continue statements with labels in C++. Now is the
> time.
> >
> > https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm has been
> > accepted into C2y, with the syntax:
> >
> > label: for (/* ... */) {
> > while (true) { break label; }
> > }
> >
> > https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf proposes to
> > update this syntax to
> >
> > for label (/* ... */) {
> > while (true) { break label; }
> > }
> >
> > While N3377 may be a bit more syntactically sound (not reusing labels
> > that are otherwise only goto targets, I'm not a fan of that idea.
>
> I think the strictly worst option would be if WG14 picked
> the N3377 syntax, but WG21 picked the N3355 syntax.
> So, WG21 needs to know WG14's opinion on N3377 before
> committing to anything.
>
> Jens
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2024-12-18 22:09:49