[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What is the equivalent of die() command of perl
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 14 Sep 2009 08:39:41 +0200
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.