Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
November 10, 2015 Feature for paranoids | ||||
---|---|---|---|---|
| ||||
Hi! Is it possible when using the "-release" indicate that this one in/out/invariant/assert should not to be disabled? WBR, Fyodor. |
November 10, 2015 Re: Feature for paranoids | ||||
---|---|---|---|---|
| ||||
Posted in reply to Fyodor Ustinov | I wouldn't recommend release mode to paranoids. I personally use `debug invariant` and `debug assert` for purely debugging code. |
November 10, 2015 Re: Feature for paranoids | ||||
---|---|---|---|---|
| ||||
Posted in reply to Fyodor Ustinov | On Tuesday, 10 November 2015 at 13:09:09 UTC, Fyodor Ustinov wrote: > Hi! > > Is it possible when using the "-release" indicate that this one in/out/invariant/assert should not to be disabled? > > WBR, > Fyodor. Since assert(false) is special (cf. http://p0nce.github.io/d-idioms/#assert%28false%29-is-special) you can use the following construct to have always-on assertions: if (!cond) assert(false); instead of: assert(cond); But -release will still remove your in/out/invariant blocks. |
November 10, 2015 Re: Feature for paranoids | ||||
---|---|---|---|---|
| ||||
Posted in reply to ponce | On Tuesday, 10 November 2015 at 15:44:26 UTC, ponce wrote:
> Since assert(false) is special (cf. http://p0nce.github.io/d-idioms/#assert%28false%29-is-special) you can use the following construct to have always-on
assert(false) AKA assert(0) - is a part of this language that I think it is absolute evil.
WBR,
Fyodor.
|
November 10, 2015 Re: Feature for paranoids | ||||
---|---|---|---|---|
| ||||
Posted in reply to Fyodor Ustinov | On Tuesday, 10 November 2015 at 13:09:09 UTC, Fyodor Ustinov wrote:
> Hi!
>
> Is it possible when using the "-release" indicate that this one in/out/invariant/assert should not to be disabled?
>
> WBR,
> Fyodor.
I don't quite get why you'd like to use -release if you are paranoid enough to be afraid of assert(0)'s little difference in behaviour. Could you give a realistic use case? At the very least seeing why it is important to you can only be beneficial to the community.
|
November 10, 2015 Re: Feature for paranoids | ||||
---|---|---|---|---|
| ||||
Posted in reply to cym13 | On Tuesday, 10 November 2015 at 20:46:14 UTC, cym13 wrote:
> I don't quite get why you'd like to use -release if you are paranoid enough to be afraid of assert(0)'s little difference in behaviour. Could you give a realistic use case? At the very least seeing why it is important to you can only be beneficial to the community.
It will be too much text on the too poor English. :)
WBR,
Fyodor.
|
November 10, 2015 Re: Feature for paranoids | ||||
---|---|---|---|---|
| ||||
Posted in reply to Fyodor Ustinov | On Tuesday, 10 November 2015 at 20:37:00 UTC, Fyodor Ustinov wrote:
>
> assert(false) AKA assert(0) - is a part of this language that I think it is absolute evil.
>
> WBR,
> Fyodor.
I would say it's a minor evil, that create problems by needing an explanation.
At this point it has been discussed to death already.
|
Copyright © 1999-2021 by the D Language Foundation