Re: Error catching
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Error catching
- From: Reuben Thomas <rrt1001@...>
- Date: 2001年1月27日 14:54:45 +0000 (GMT)
On 2001年1月26日, Steve Dekorte wrote:
>
> Jakab, Steve wrote:
> > ...if an array-out-of-bounds
> > access happens, the result is set to nil. Is there any way to have Lua pass
> > these results back as an error condition to the calling C code instead
> > (without changing the Lua source code)?
>
> The array-out-of-bounds can be handled within lua using the "index" tag.
>
> See: http://www.tecgraf.puc-rio.br/lua/manual/manual.html#4.8
As for the division behaviour, that's completely standard (according to IEEE
rules), but easily changed, assuming you have fenv.h on your system: you
just need to change the floating point exception state of the program
hosting Lua, using fesetexcept flag. If you can't do this you're on your
own, and may have to change the Lua source (but that's easy).
--
http://sc3d.org/rrt/ | computation, n. automated pedantry