Beeflang - open source performance-oriented compiled programming language

Basile B. b2.temp at gmx.com
Thu Jan 9 17:30:15 UTC 2020


On Thursday, 9 January 2020 at 17:19:38 UTC, Gregor Mückl wrote:
> On Thursday, 9 January 2020 at 16:58:16 UTC, Basile B. wrote:
>>   5. `repeat {} while ()` and `do {}` lacks of orthogonality. 
>> `do {} while (false);` could
>>      have been used instead, saving `repeat`. This new 
>> statement a very few value added
>>      but I understand that it's tempting to invent small 
>> things like that when creating a
>>      language.
>
> do {} has a separate meaning in beef. These blocks are not 
> looping, but using break; is valid in them to skip to their 
> end. While this is certainly creative, I don't know if it all 
> that useful. But it burns the "do" keyword in the grammar and 
> something else is required to start a do/while block.

Yes I understand the difference but by using `while (false)` in D 
for the looping condition you get the **same semantic** as Beef's 
`do {}`. Than a small AST rewrite or more simply the backend 
optimizations get ride very extremely easily of the codegen for 
the useless looping condition

example: https://godbolt.org/z/LgHL_V


More information about the Digitalmars-d mailing list