lua-users home
lua-l archive

level argument for assert

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


The error function is defined as;
 error (message [, level])
The assert function is defined as;
 assert (v [, message])
Is there a specific reason the assert function doesn't have a 'level' argument that allows to throw the error up some levels? Eg. have assert defined as;
 assert (v [, message [, level]])
Currently I use;
 if not v then error(message, level) end
But I would prefer the shorter assert notation
Thijs

AltStyle によって変換されたページ (->オリジナル) /