Re: assert in EUPHORIA

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

I can see the benefit of Shawn's idea of using a type for assertion here: when you're translating, the side-effectless type-check call is removed entirely...

I do something like this in EuSQL. You can set it to do actual error checking or just print errors (or call a user defined routine). And, of course, you can simply turn off type checking to ignore it completely.

Basically, this just handles errors coming back from the library (e.g., bad SQL, incorrect table name, etc.), so there isn't really an expensive performance hit for additional calculations. It's just a relatively simple and informative way to handle error checking.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu