lua-users home
lua-l archive

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



On 18-Nov-05, at 10:05 AM, Mike Pall wrote:

- Even after a few days of discovering it, I'm not sure what
  table.maxn() is good for. IMHO it's superfluous and may
  confuse newbies.

I agree (see <http://lua-users.org/lists/lua-l/2005-11/msg00133.html>)


- I suggest to make the NaN tests explicit and overridable:

    #define luai_numisnan(a) ((a)!=(a))

  [In case anyone wonders: isnan() is only defined in C99.]

I'm not convinced by this. (I agree with making the test explicit, just not with the avoidance of isnan()). isnan() is in POSIX (since Issue 3, it says here); furthermore, it has quite a long history of being implemented, including in all the IEEE-754 emulation libraries I've used. (It may require #include <ieee.h>, or some other non-standard header.) On the other hand, I've certainly seen C compilers (though I admit not for a long time) which would cheerfully optimize away the (a)!=(a) check (which certainly should be optimized away if a is an integer type.)