lua-users home
lua-l archive

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


2010/9/12 Dušan Majkić <dmajkic@gmail.com>:
>>> 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

Oh, I see. So exactly like how Ruby does it, then. I wouldn't mind that at all.

~Jonathan