lua-users home
lua-l archive

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


On Jul 27, 2011, at 7:02 AM, Antonio Vieiro wrote:

> I know it's no so easy to use as a 'for' loop, but it's 'easier' for me to always close things no matter what I do.

In that case, you might be interested by the various try/catch/finalize mechanisms floating around.

For example, here is a take by Diego Nehab:

http://lua-users.org/wiki/FinalizedExceptions

Another example by Tom Harris:

http://whoopdedo.org/doku/lua/index

More reading:

http://lua-users.org/wiki/ErrorHandling