digitalmars.D.learn - Feature for paranoids
- Fyodor Ustinov (5/5) Nov 10 2015 Hi!
- Kagamin (2/2) Nov 10 2015 I wouldn't recommend release mode to paranoids. I personally use
- ponce (10/15) Nov 10 2015 Since assert(false) is special (cf.
- Fyodor Ustinov (5/8) Nov 10 2015 assert(false) AKA assert(0) - is a part of this language that I
- ponce (5/9) Nov 10 2015 I would say it's a minor evil, that create problems by needing an
- cym13 (7/12) Nov 10 2015 I don't quite get why you'd like to use -release if you are
- Fyodor Ustinov (4/9) Nov 10 2015 It will be too much text on the too poor English. :)
Hi! Is it possible when using the "-release" indicate that this one in/out/invariant/assert should not to be disabled? WBR, Fyodor.
Nov 10 2015
I wouldn't recommend release mode to paranoids. I personally use `debug invariant` and `debug assert` for purely debugging code.
Nov 10 2015
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.
Nov 10 2015
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-onassert(false) AKA assert(0) - is a part of this language that I think it is absolute evil. WBR, Fyodor.
Nov 10 2015
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.
Nov 10 2015
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.
Nov 10 2015
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.
Nov 10 2015