Re: Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Tommi
On Sunday, 7 July 2013 at 13:42:52 UTC, Tommi wrote: Then, yet another solution (a code breaking one) would be to make it so that only literally saying: assert(0); or assert(false); or assert(null); ...would exhibit that special assert behaviour. Anything else would be semantically runtime-eva

Re: Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Tommi
On Sunday, 7 July 2013 at 13:12:06 UTC, Tommi wrote: But would it be possible to implement it something like: [..] Although, I don't know if the best possible behaviour is to silently compile the following assert out of existence in release mode: version (assert) { enum cond = false; }

Re: Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Denis Shelomovskij
07.07.2013 17:12, Tommi пишет: On Sunday, 7 July 2013 at 12:30:28 UTC, Andrej Mitrovic wrote: On 7/7/13, Tommi wrote: Sometimes you need to have some extra data to check against in the assert expression. That data isn't needed in release mode when assertions are ignored. Therefore, you put tha

Re: Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Tommi
On Sunday, 7 July 2013 at 13:12:06 UTC, Tommi wrote: [..] Then, when parsing assert expressions, if an undefined symbol is found, the compiler would check that separate list of symbols that it has been keeping, and if the symbol is found there and use of the symbol is syntactically correct, the

Re: Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Tommi
On Sunday, 7 July 2013 at 12:30:28 UTC, Andrej Mitrovic wrote: On 7/7/13, Tommi wrote: Sometimes you need to have some extra data to check against in the assert expression. That data isn't needed in release mode when assertions are ignored. Therefore, you put that extra data inside a version(as

Re: Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Peter Alexander
On Sunday, 7 July 2013 at 12:30:28 UTC, Andrej Mitrovic wrote: I've ran into an issue when implementing this feature back in February (see the pull request): http://d.puremagic.com/issues/show_bug.cgi?id=9450 https://github.com/D-Programming-Language/dmd/pull/1614 WTF: Hmm.. I think we migh

Re: Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Andrej Mitrovic
On 7/7/13, Tommi wrote: > Sometimes you need to have some extra data to check against in > the assert expression. That data isn't needed in release mode > when assertions are ignored. Therefore, you put that extra data > inside a version(assert). But then those assertions fail to > compile in rele

Feature request: assert expressions should live inside version(assert)

2013-07-07 Thread Tommi
Sometimes you need to have some extra data to check against in the assert expression. That data isn't needed in release mode when assertions are ignored. Therefore, you put that extra data inside a version(assert). But then those assertions fail to compile in release mode because the symbol loo