lua-users home
lua-l archive

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


> Ah, but we use pcall for that - try/except in Lua would be sugar for that idiom.

> Sugar is fine when it does not have any runtime costs (e.g. a:f(b) is
> short for a.f(a,b)) but in this case a closure would be silently
> constructed.

May  think  about  short  from to define function. For me real problem
with  `try(function()...`  is  that  word function is too long. I do not
bother much about create closure and do 2 more calls. At least in most
cases. But word function is really annoying :)

--
С уважением,
 Alexey                          mailto:alexeymelnichuck@gmail.com


---
Это сообщение проверено на вирусы антивирусом Avast.
https://www.avast.com/antivirus