Re: assert in EUPHORIA
- Posted by DerekParnell (admin) Apr 23, 2012
- 1370 views
petelomax said...
DerekParnell said...
Although this will perform the testing correctly, it misses out on a couple of the useful aspects of the 'assert' concept.
- It always executes the test. The assert is intended to only execute the test during the development phase of the application.
That is what I was going to say about your assert.e; although it may not actually test whether x is 0 when "switched off", it will still calculate x, which may be expensive.
Regards, Pete
I see your point. The only way around that at the moment is to code ...
ifdef assert then assert(x) end ifdef
This is a bit more cumbersome but if you really need it then you can do it.