Is it possible to exit a contract?

berni someone at somemail.de
Thu Mar 22 13:16:00 UTC 2018


Part of my code looks like this:

> out (result)
> {
>   if (result==true)
>   {
>     lots of assertions...
>   }
> }

I would prefer an early exit like:

> out (result)
> {
>   if (result==false) return;
> 
>   lots of assertions...
> }

Is this possible somehow (return and break don't do the job...). 
The only thing I found is using goto, which I prefer over that 
gigantic if-block, but maybe there is something better, I don't 
know of?


More information about the Digitalmars-d-learn mailing list