[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Questions and Thoughts
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 21 Mar 2000 21:47:02 -0300 (EST)
>From: Ken Rawlings <krawling@bluemarble.net>
>
> What i'm thinking of is more along the lines of something like Java/C++
> exception handling:
>
> try
> -- do something
> catch
> -- if an error occurred
> finally
> -- always done
> end
If "do something" can be put into a function, then the code above can be written
if call(do_something,args,"x") then
-- catch error
end
-- always done
"call" also accepts a function to serve as temporary error handler.
See http://www.tecgraf.puc-rio.br/lua/manual/manual.html#call
--lhf