DIP 1003 Formal Review

MysticZach via Digitalmars-d digitalmars-d at puremagic.com
Sun May 14 18:41:47 PDT 2017


On Monday, 15 May 2017 at 01:39:34 UTC, MysticZach wrote:
> Not that a whole new way of doing things is called for... but I 
> think a better design would have been to allow 'in' and 'out' 
> statements in the function itself, with no need for brackets if 
> you only have one line's worth of contract, e.g.,
>
> int fun(int a) {
>   in assert(...);
>   out(x) assert(...);
>
>   // do stuff
> }

You could even accumulate in statement if you want to save on 
brackets and indentation:
int fun() {
   in assert(...);
   in assert2(...);

   // etc.
}


More information about the Digitalmars-d mailing list