Re: assert in EUPHORIA

new topic     » goto parent     » topic index » view thread      » older message » newer message
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.

  1. 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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu