DIP 1003: remove `body` as a keyword

Timon Gehr via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Nov 23 12:32:36 PST 2016


On 23.11.2016 11:15, Sönke Ludwig wrote:
>>
>> The more important point is that there is no precedent where {...}{...}
>> are two components of the same entity, it looks ugly even with the
>> space-wasting convention where '{' is put on its own line. Not all
>> contracts are one-liners like in your example above (which looks almost
>> tolerable).
>
> It can happen all the time with normal block statements. Especially
> something like 'scope' that works outside of the normal program flow has
> a certain similarity:
>
>     scope (exit) { assert(n > 0); }
>     {
>         n += 1;
>     }

This is not a counterexample, because the block statement following the 
scope statement is not part of the scope statement. I.e. if anything, it 
is bad that this looks similar, because it is grammatically different.

(Also, in my code there are usually exactly zero block statements nested 
directly in block statements.)


More information about the Digitalmars-d-announce mailing list