'goto', as an indicator of good language

Nick Treleaven nick at geany.org
Fri Sep 9 15:49:03 UTC 2022


On Friday, 9 September 2022 at 14:18:04 UTC, Paul Backus wrote:
> On Friday, 9 September 2022 at 14:03:57 UTC, Nick Treleaven 
> wrote:
>> Where `switch` works like `switch(0) default:` today.
>
> I think maybe a more intuitive keyword for this would be `do`:
>
> ```d
> do
> {
>     // ...
>     if (whatever) break;
>     // ...
> }
> ```
>
> ...which would work like `do { ... } while (0);` currently does.

So continue would do the same as break? Bit weird.
Also you don't know if it's a loop or not until you find the 
closing brace. It's better to know in advance.



More information about the Digitalmars-d mailing list