[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua_newthread etc.
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 22 Jan 2003 15:16:27 -0200
>lua_newthread() does not seem to be checking its state allocation
>(luaE_newthread->mallocstate in state.c) for possible failure.
Thanks, we'll check this.
>Also, has it been considered to extend the math library with isnan() and
>infinity() so that Lua can check against exceptional floating point values?
No, because these functions are not ANSI C functions. At least, not C89.
Perhaps C99 contains them, I'm not sure, but our target language for
implementing Lua will remain C89 until C99 compilers become the norm. Even
for C89, which has been a standard for 10 years now, compilers have their
own ideas about dark and not so dark corners of the languague, which we
have learned to avoid... I expect that the same thing will happen with C99
compilers, and C99 seems to have quite a large share of dark corners. :-(
On the other hand, I do have a draft IEEE math library that I'll probably
distribute when Lua 5.0 final is released. It's pretty simple anyway.
Finally, you can write those in Lua:
function isnan(x) return x~=x end
function isinfinity(x) return x+1==x end