lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > I don't see this as a problem. Having the traceback show assert is
> > a good thing in this case because it shows that an assertion failed.
> 
> True, but it can also give the impression that the problem is a bug in
> your module. 

For a moderately competent programmer like myself, the problem may
well be just that — a bug in my module.  

I don't use assertions only in a paradigm of paragon module author
protecting flawless code from blunders of sloppy users.  I use them when
coding complicated algorithms to check theoretical invariants.  If they
fail, it means I made a mistake in the coding.  I keep the assertion
in even after the code is supposed to debugged, because that particular 
set of circumstances that trigger the coding mistake, if any, may be 
quite rare.  

I like assert just fine the way it is (as I do with almost all of Lua).

Dirk