On 26/11/2017 11:59 AM, Joseph Rushton Wakeling wrote:
On Tuesday, 21 November 2017 at 14:15:30 UTC, Martin Nowak wrote:
https://github.com/dlang/DIPs/blob/master/DIPs/DIP1006.md

Has come up a couple of times and it's a good idea to allow more control over which checks are enabled. I find the suggested switch levels a bit counter-intuitive and would suggest

  -release=assert,in,out,invariant

to be the equivalent of the current

  -release

while allowing to enable any subset

I like the idea of specializing the meaning of the -release flag via optional arguments.

One suggestion: replace -release=assert with -release=body, so in the above, you would have:

     -release=body,in,out,invariant

... which has the nice intuitive property of specifying _which bits of code_ release criteria will be applied to.

In other words, -release=body would result in asserts being removed from function bodies _and only there_.  That would make clearer that we're not removing asserts from e.g. unittests (or indeed contracts or invariants).

Agreed that looks good +1

Reply via email to