[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: try..catch for Lua 5.2?
- From: Dušan Majkić <dmajkic@...>
- Date: Sun, 12 Sep 2010 10:22:43 +0200
>> Since there is no "begin" in lua, I'll wote for leaving out "try".
>
> What do you mean by "begin"? If you want an explicit lexical scope,
> you can always use do...end.
There is no reason to start a block with "try" in lua.
function luafunc()
local l
livelongandprosper()
catch E
print E.message
end
and if you want to do exception handlig on block
function luafunc()
local l
do
livelongandprosper()
catch E
print E.message
end
here_even_if_things_went_wrong()
end