lua-users home
lua-l archive

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


On Mon, Sep 14, 2009 at 8:07 AM, Andrea D'Amore <and.damore@gmail.com> wrote:
> Doesn't this apply when assert is used as a statement too?

Sure.  Function calls are allowed to be statements.  The cool thing
about Lua's assert is that it can be used as a function.

You could say something Perlish like this:

f = io.open(file) or die 'cannot open'

But AFAIK there's no way then to use the actual error message returned.

steve d.