C++ Logo

std-proposals

Advanced search

Re: [std-proposals] !continue

From: Brian Bi <bbi5291_at_[hidden]>
Date: Sun, 5 Nov 2023 16:11:03 -0500
On Sun, Nov 5, 2023, 4:03 PM Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Sun, Nov 5, 2023 at 8:42 PM Brian Bi <bbi5291_at_[hidden]> wrote:
> >
> > I've encountered this before when writing parsing code. Sometimes you
> want to transition to a different state and then re-process the current
> character.
> >
> > I dealt with it by using `goto` to jump to the beginning of the loop
> body. I think this is a better option than introducing a new and obscure
> control flow construct.
>
> They say behavioural modernity began in humans around about 20,000 -
> 100,000 years ago, when we started showing more sophisticated
> behaviours. Since then though, some communities of people have swayed
> toward intrigue at new ideas, while other communities have swayed
> toward suspicion of new ideas.
>
> Something which is new, that we haven't encountered before, can be
> called a number of things: unusual, strange, odd, weird, or we can try
> to put a more positive spin on it like 'innovational' or
> 'cutting-edge'.
>
> Applying the exclamation operator to the 'continue' keyword as I've
> proposed, is certainly something new, but I don't think there's
> anything obscure or outlandish about it. I think it's far less obscure
> that using 'goto' to jump back to the start of the loop.
>
> People won't be scratching their heads for very long when they see
> "!continue" -- I think the syntax accurately portrays what it does.
>

1. When I saw the subject line of your email, I was unable to guess what
this feature was supposed to do.

2. The situations where I've needed to go to the next iteration of a loop
without incrementing the counter were rare. This suggests to me that if
this feature existed, the average C++ programmer would see it so rarely
that every time they see it, they will have forgotten what it means.

If we're going to add a feature to the language that has the above
properties, it should be one that significantly improves over the currently
available alternatives.

-- 
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-11-05 21:11:15