I'd love to have this functionality, but it's worth noting that some code (e.g. Optim) has assert being used for error handling right now. So there'd need to be a period where people transition away from using assertions for error-handling rather than for testing.
-- John On Jul 24, 2014, at 11:35 AM, Tim Holy <[email protected]> wrote: > I would bet it's just that no one has gotten around to implementing it yet. > Feel free to take the reigns here. You could create a julia startup option > that causes `@assert` to be defined as a no-op, which would completely > eliminate any performance hit. > > --Tim > > On Thursday, July 24, 2014 05:43:07 AM Magnus Lie Hetland wrote: >> If I read the code right, there's no standard way to disable assertions, >> right? Given that this is a rather common functionality in many languages, >> is this something you have explicitly decided not to support (in the >> default implementation)? It would be easy enough to roll my own – but if >> there is good reason not to, then I'd rather not :-) >> >> Whether or not there's a performance hit would depend on how costly your >> assertion expression is, I guess. If, for example, you check some involved >> invariant over a large structure, that's something you might want to >> disable if you were to do a benchmark, for example. (I guess this might be >> an argument for something like a debug flag in general.) This could >> certainly be handled by using a test external to the code for this sort of >> thing, and using assertions only for the minor things. That won't give you >> the same access, though. >
