|
> Unfortunately, it is not possible with assert, you *must* pass a string.This is supported in Lua 5.3.0 (work3).
> I think it can be great to also have assert working like error so the
For Lua 5.2, you can simply redefine assert:
function assert(cond,...)
if cond then
return cond,...
else
error(...)
end
end
This is how assert is implemented in 5.3.