lua-users home
lua-l archive

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

On Thu, Sep 10, 2009 at 1:54 PM, Anurag Sharma
<> wrote:
> Is there any equivalent in Lua.. If yes, what is it?

Lua also uses assert() a lot. For instance,

assert(Myfunction(),"we failed")

More interesting is this:

f = assert(

This actually gives a sensible error trace, because if fails
it returns two values, nil and an error message. The second parameter
of assert() is the message string, so it works as expected.

steve d.