[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: ‘continue’ keyword
- From: Federico Ferri <federico.ferri.it@...>
- Date: Fri, 13 May 2022 15:01:35 +0200
Obviously I meant 'continue' and ::continue::, as 'break' already exists.
The difference between 'break' and 'goto' is that you can use 'break' without argument, and it will exit from the *current* loop. But to do the same with 'goto', you need to also define the label for the goto, and this extra repetitive step is what people tend to dislike.
The language could do a favor to the programmer, and define -or imply it exists anyway- a ::break:: label that points to the end of the *current* for loop, then you could say 'break' it is roughly the same as 'goto ::break::' ;)
On Thu, May 12, 2022 at 8:23 PM ubq323 <firstname.lastname@example.org> wrote:
> Also I know that theoretically this can achieved using ‘goto’ but I don’t
> like that approach.
why not? it has the same effect